1. 02 4月, 2016 1 次提交
  2. 03 1月, 2016 1 次提交
  3. 07 1月, 2015 1 次提交
  4. 07 5月, 2014 1 次提交
    • B
      pgindent run for 9.4 · 0a783200
      Bruce Momjian 提交于
      This includes removing tabs after periods in C comments, which was
      applied to back branches, so this change should not effect backpatching.
      0a783200
  5. 07 2月, 2014 1 次提交
  6. 24 1月, 2014 1 次提交
    • T
      Allow use of "z" flag in our printf calls, and use it where appropriate. · ac4ef637
      Tom Lane 提交于
      Since C99, it's been standard for printf and friends to accept a "z" size
      modifier, meaning "whatever size size_t has".  Up to now we've generally
      dealt with printing size_t values by explicitly casting them to unsigned
      long and using the "l" modifier; but this is really the wrong thing on
      platforms where pointers are wider than longs (such as Win64).  So let's
      start using "z" instead.  To ensure we can do that on all platforms, teach
      src/port/snprintf.c to understand "z", and add a configure test to force
      use of that implementation when the platform's version doesn't handle "z".
      
      Having done that, modify a bunch of places that were using the
      unsigned-long hack to use "z" instead.  This patch doesn't pretend to have
      gotten everyplace that could benefit, but it catches many of them.  I made
      an effort in particular to ensure that all uses of the same error message
      text were updated together, so as not to increase the number of
      translatable strings.
      
      It's possible that this change will result in format-string warnings from
      pre-C99 compilers.  We might have to reconsider if there are any popular
      compilers that will warn about this; but let's start by seeing what the
      buildfarm thinks.
      
      Andres Freund, with a little additional work by me
      ac4ef637
  7. 08 1月, 2014 1 次提交
  8. 17 6月, 2013 1 次提交
    • J
      Add buffer_std flag to MarkBufferDirtyHint(). · b8fd1a09
      Jeff Davis 提交于
      MarkBufferDirtyHint() writes WAL, and should know if it's got a
      standard buffer or not. Currently, the only callers where buffer_std
      is false are related to the FSM.
      
      In passing, rename XLOG_HINT to XLOG_FPI, which is more descriptive.
      
      Back-patch to 9.3.
      b8fd1a09
  9. 22 3月, 2013 1 次提交
    • S
      Allow I/O reliability checks using 16-bit checksums · 96ef3b8f
      Simon Riggs 提交于
      Checksums are set immediately prior to flush out of shared buffers
      and checked when pages are read in again. Hint bit setting will
      require full page write when block is dirtied, which causes various
      infrastructure changes. Extensive comments, docs and README.
      
      WARNING message thrown if checksum fails on non-all zeroes page;
      ERROR thrown but can be disabled with ignore_checksum_failure = on.
      
      Feature enabled by an initdb option, since transition from option off
      to option on is long and complex and has not yet been implemented.
      Default is not to use checksums.
      
      Checksum used is WAL CRC-32 truncated to 16-bits.
      
      Simon Riggs, Jeff Davis, Greg Smith
      Wide input and assistance from many community members. Thank you.
      96ef3b8f
  10. 02 1月, 2013 1 次提交
  11. 31 8月, 2012 1 次提交
    • A
      Split tuple struct defs from htup.h to htup_details.h · c219d9b0
      Alvaro Herrera 提交于
      This reduces unnecessary exposure of other headers through htup.h, which
      is very widely included by many files.
      
      I have chosen to move the function prototypes to the new file as well,
      because that means htup.h no longer needs to include tupdesc.h.  In
      itself this doesn't have much effect in indirect inclusion of tupdesc.h
      throughout the tree, because it's also required by execnodes.h; but it's
      something to explore in the future, and it seemed best to do the htup.h
      change now while I'm busy with it.
      c219d9b0
  12. 02 1月, 2012 1 次提交
  13. 01 9月, 2011 1 次提交
  14. 02 1月, 2011 1 次提交
  15. 21 9月, 2010 1 次提交
  16. 19 8月, 2010 1 次提交
    • R
      Tidy up a few calls to smrgextend(). · d37781fa
      Robert Haas 提交于
      In the new API introduced by my patch to include the backend ID in
      temprel filenames, the last argument to smrgextend() became skipFsync
      rather than isTemp, but these calls didn't get the memo.  It's not
      really a problem to pass rel->rd_istemp rather than just plain false,
      because smgrextend() now automatically skips the fsync for temprels
      anyway, but this seems cleaner and saves some minute number of cycles.
      d37781fa
  17. 14 8月, 2010 1 次提交
    • R
      Include the backend ID in the relpath of temporary relations. · debcec7d
      Robert Haas 提交于
      This allows us to reliably remove all leftover temporary relation
      files on cluster startup without reference to system catalogs or WAL;
      therefore, we no longer include temporary relations in XLOG_XACT_COMMIT
      and XLOG_XACT_ABORT WAL records.
      
      Since these changes require including a backend ID in each
      SharedInvalSmgrMsg, the size of the SharedInvalidationMessage.id
      field has been reduced from two bytes to one, and the maximum number
      of connections has been reduced from INT_MAX / 4 to 2^23-1.  It would
      be possible to remove these restrictions by increasing the size of
      SharedInvalidationMessage by 4 bytes, but right now that doesn't seem
      like a good trade-off.
      
      Review by Jaime Casanova and Tom Lane.
      debcec7d
  18. 26 2月, 2010 1 次提交
  19. 10 2月, 2010 1 次提交
    • T
      Fix up rickety handling of relation-truncation interlocks. · cbe9d6be
      Tom Lane 提交于
      Move rd_targblock, rd_fsm_nblocks, and rd_vm_nblocks from relcache to the smgr
      relation entries, so that they will get reset to InvalidBlockNumber whenever
      an smgr-level flush happens.  Because we now send smgr invalidation messages
      immediately (not at end of transaction) when a relation truncation occurs,
      this ensures that other backends will reset their values before they next
      access the relation.  We no longer need the unreliable assumption that a
      VACUUM that's doing a truncation will hold its AccessExclusive lock until
      commit --- in fact, we can intentionally release that lock as soon as we've
      completed the truncation.  This patch therefore reverts (most of) Alvaro's
      patch of 2009-11-10, as well as my marginal hacking on it yesterday.  We can
      also get rid of assorted no-longer-needed relcache flushes, which are far more
      expensive than an smgr flush because they kill a lot more state.
      
      In passing this patch fixes smgr_redo's failure to perform visibility-map
      truncation, and cleans up some rather dubious assumptions in freespace.c and
      visibilitymap.c about when rd_fsm_nblocks and rd_vm_nblocks can be out of
      date.
      cbe9d6be
  20. 09 2月, 2010 1 次提交
  21. 03 1月, 2010 1 次提交
  22. 11 6月, 2009 1 次提交
  23. 21 1月, 2009 1 次提交
  24. 02 1月, 2009 1 次提交
  25. 03 12月, 2008 1 次提交
  26. 27 11月, 2008 2 次提交
  27. 19 11月, 2008 1 次提交
    • H
      Rethink the way FSM truncation works. Instead of WAL-logging FSM · 33960006
      Heikki Linnakangas 提交于
      truncations in FSM code, call FreeSpaceMapTruncateRel from smgr_redo. To
      make that cleaner from modularity point of view, move the WAL-logging one
      level up to RelationTruncate, and move RelationTruncate and all the
      related WAL-logging to new src/backend/catalog/storage.c file. Introduce
      new RelationCreateStorage and RelationDropStorage functions that are used
      instead of calling smgrcreate/smgrscheduleunlink directly. Move the
      pending rel deletion stuff from smgrcreate/smgrscheduleunlink to the new
      functions. This leaves smgr.c as a thin wrapper around md.c; all the
      transactional stuff is now in storage.c.
      
      This will make it easier to add new forks with similar truncation logic,
      like the visibility map.
      33960006
  28. 01 11月, 2008 1 次提交
    • H
      Update FSM on WAL replay. This is a bit limited; the FSM is only updated · e9816533
      Heikki Linnakangas 提交于
      on non-full-page-image WAL records, and quite arbitrarily, only if there's
      less than 20% free space on the page after the insert/update (not on HOT
      updates, though). The 20% cutoff should avoid most of the overhead, when
      replaying a bulk insertion, for example, while ensuring that pages that
      are full are marked as full in the FSM.
      
      This is mostly to avoid the nasty worst case scenario, where you replay
      from a PITR archive, and the FSM information in the base backup is really
      out of date. If there was a lot of pages that the outdated FSM claims to
      have free space, but don't actually have any, the first unlucky inserter
      after the recovery would traverse through all those pages, just to find
      out that they're full. We didn't have this problem with the old FSM
      implementation, because we simply threw the FSM information away on a
      non-clean shutdown.
      e9816533
  29. 31 10月, 2008 1 次提交
    • H
      Unite ReadBufferWithFork, ReadBufferWithStrategy, and ZeroOrReadBuffer · 19c8dc83
      Heikki Linnakangas 提交于
      functions into one ReadBufferExtended function, that takes the strategy
      and mode as argument. There's three modes, RBM_NORMAL which is the default
      used by plain ReadBuffer(), RBM_ZERO, which replaces ZeroOrReadBuffer, and
      a new mode RBM_ZERO_ON_ERROR, which allows callers to read corrupt pages
      without throwing an error. The FSM needs the new mode to recover from
      corrupt pages, which could happend if we crash after extending an FSM file,
      and the new page is "torn".
      
      Add fork number to some error messages in bufmgr.c, that still lacked it.
      19c8dc83
  30. 01 10月, 2008 2 次提交
  31. 30 9月, 2008 2 次提交
    • T
      Fix compiler warning (unportable sprintf usage) · 6ca1b1cd
      Tom Lane 提交于
      6ca1b1cd
    • H
      Rewrite the FSM. Instead of relying on a fixed-size shared memory segment, the · 15c121b3
      Heikki Linnakangas 提交于
      free space information is stored in a dedicated FSM relation fork, with each
      relation (except for hash indexes; they don't use FSM).
      
      This eliminates the max_fsm_relations and max_fsm_pages GUC options; remove any
      trace of them from the backend, initdb, and documentation.
      
      Rewrite contrib/pg_freespacemap to match the new FSM implementation. Also
      introduce a new variant of the get_raw_page(regclass, int4, int4) function in
      contrib/pageinspect that let's you to return pages from any relation fork, and
      a new fsm_page_contents() function to inspect the new FSM pages.
      15c121b3
  32. 10 3月, 2008 1 次提交
  33. 02 1月, 2008 1 次提交
  34. 06 1月, 2007 1 次提交
  35. 24 11月, 2006 1 次提交
  36. 04 10月, 2006 1 次提交
  37. 22 9月, 2006 1 次提交
    • T
      Fix free space map to correctly track the total amount of FSM space needed · 9e936693
      Tom Lane 提交于
      even when a single relation requires more than max_fsm_pages pages.  Also,
      make VACUUM emit a warning in this case, since it likely means that VACUUM
      FULL or other drastic corrective measure is needed.  Per reports from Jeff
      Frost and others of unexpected changes in the claimed max_fsm_pages need.
      9e936693