1. 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
  2. 30 10月, 2008 1 次提交
  3. 23 9月, 2008 1 次提交
  4. 09 9月, 2008 1 次提交
    • T
      Fix a couple of problems pointed out by Fujii Masao in the 2008-Apr-05 patch · ead21631
      Tom Lane 提交于
      for pg_stop_backup.  First, it is possible that the history file name is not
      alphabetically later than the last WAL file name, so we should explicitly
      check that both have been archived.  Second, the previous coding would wait
      forever if a checkpoint had managed to remove the WAL file before we look for
      it.
      
      Simon Riggs, plus some code cleanup by me.
      ead21631
  5. 11 8月, 2008 1 次提交
    • H
      Introduce the concept of relation forks. An smgr relation can now consist · 3f0e808c
      Heikki Linnakangas 提交于
      of multiple forks, and each fork can be created and grown separately.
      
      The bulk of this patch is about changing the smgr API to include an extra
      ForkNumber argument in every smgr function. Also, smgrscheduleunlink and
      smgrdounlink no longer implicitly call smgrclose, because other forks might
      still exist after unlinking one. The callers of those functions have been
      modified to call smgrclose instead.
      
      This patch in itself doesn't have any user-visible effect, but provides the
      infrastructure needed for upcoming patches. The additional forks envisioned
      are a rewritten FSM implementation that doesn't rely on a fixed-size shared
      memory block, and a visibility map to allow skipping portions of a table in
      VACUUM that have no dead tuples.
      3f0e808c
  6. 14 7月, 2008 1 次提交
    • T
      Clean up the use of some page-header-access macros: principally, use · 9d035f42
      Tom Lane 提交于
      SizeOfPageHeaderData instead of sizeof(PageHeaderData) in places where that
      makes the code clearer, and avoid casting between Page and PageHeader where
      possible.  Zdenek Kotala, with some additional cleanup by Heikki Linnakangas.
      
      I did not apply the parts of the proposed patch that would have resulted in
      slightly changing the on-disk format of hash indexes; it seems to me that's
      not a win as long as there's any chance of having in-place upgrade for 8.4.
      9d035f42
  7. 01 7月, 2008 1 次提交
  8. 12 6月, 2008 1 次提交
    • H
      Refactor XLogOpenRelation() and XLogReadBuffer() in preparation for relation · a213f1ee
      Heikki Linnakangas 提交于
      forks. XLogOpenRelation() and the associated light-weight relation cache in
      xlogutils.c is gone, and XLogReadBuffer() now takes a RelFileNode as argument,
      instead of Relation.
      
      For functions that still need a Relation struct during WAL replay, there's a
      new function called CreateFakeRelcacheEntry() that returns a fake entry like
      XLogOpenRelation() used to.
      a213f1ee
  9. 09 6月, 2008 1 次提交
  10. 28 5月, 2008 1 次提交
  11. 18 5月, 2008 1 次提交
    • T
      Fix a subtle bug exposed by recent wal_sync_method rearrangements. · 1a604b4e
      Tom Lane 提交于
      Formerly, the default value of wal_sync_method was determined inside xlog.c,
      but now it is determined inside guc.c.  guc.c was reading xlogdefs.h
      without having read <fcntl.h>, leading to wrong determination of
      DEFAULT_SYNC_METHOD.  Obviously xlogdefs.h needs to include <fcntl.h>
      for itself to ensure stable results.
      1a604b4e
  12. 17 5月, 2008 1 次提交
  13. 14 5月, 2008 2 次提交
  14. 13 5月, 2008 2 次提交
  15. 12 5月, 2008 3 次提交
  16. 09 5月, 2008 2 次提交
  17. 24 4月, 2008 1 次提交
  18. 23 4月, 2008 1 次提交
  19. 21 4月, 2008 1 次提交
    • T
      Allow float8, int8, and related datatypes to be passed by value on machines · 8472bf7a
      Tom Lane 提交于
      where Datum is 8 bytes wide.  Since this will break old-style C functions
      (those still using version 0 calling convention) that have arguments or
      results of these types, provide a configure option to disable it and retain
      the old pass-by-reference behavior.  Likewise, provide a configure option
      to disable the recently-committed float4 pass-by-value change.
      
      Zoltan Boszormenyi, plus configurability stuff by me.
      8472bf7a
  20. 17 4月, 2008 1 次提交
    • T
      Repair two places where SIGTERM exit could leave shared memory state · d1cbd26d
      Tom Lane 提交于
      corrupted.  (Neither is very important if SIGTERM is used to shut down the
      whole database cluster together, but there's a problem if someone tries to
      SIGTERM individual backends.)  To do this, introduce new infrastructure
      macros PG_ENSURE_ERROR_CLEANUP/PG_END_ENSURE_ERROR_CLEANUP that take care
      of transiently pushing an on_shmem_exit cleanup hook.  Also use this method
      for createdb cleanup --- that wasn't a shared-memory-corruption problem,
      but SIGTERM abort of createdb could leave orphaned files lying around.
      
      Backpatch as far as 8.2.  The shmem corruption cases don't exist in 8.1,
      and the createdb usage doesn't seem important enough to risk backpatching
      further.
      d1cbd26d
  21. 05 4月, 2008 1 次提交
  22. 26 3月, 2008 1 次提交
    • T
      Simplify and standardize conversions between TEXT datums and ordinary C · 220db7cc
      Tom Lane 提交于
      strings.  This patch introduces four support functions cstring_to_text,
      cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and
      two macros CStringGetTextDatum and TextDatumGetCString.  A number of
      existing macros that provided variants on these themes were removed.
      
      Most of the places that need to make such conversions now require just one
      function or macro call, in place of the multiple notational layers that used
      to be needed.  There are no longer any direct calls of textout or textin,
      and we got most of the places that were using handmade conversions via
      memcpy (there may be a few still lurking, though).
      
      This commit doesn't make any serious effort to eliminate transient memory
      leaks caused by detoasting toasted text objects before they reach
      text_to_cstring.  We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few
      places where it was easy, but much more could be done.
      
      Brendan Jurd and Tom Lane
      220db7cc
  23. 10 3月, 2008 1 次提交
  24. 17 2月, 2008 1 次提交
    • T
      Replace time_t with pg_time_t (same values, but always int64) in on-disk · cd004067
      Tom Lane 提交于
      data structures and backend internal APIs.  This solves problems we've seen
      recently with inconsistent layout of pg_control between machines that have
      32-bit time_t and those that have already migrated to 64-bit time_t.  Also,
      we can get out from under the problem that Windows' Unix-API emulation is not
      consistent about the width of time_t.
      
      There are a few remaining places where local time_t variables are used to hold
      the current or recent result of time(NULL).  I didn't bother changing these
      since they do not affect any cross-module APIs and surely all platforms will
      have 64-bit time_t before overflow becomes an actual risk.  time_t should
      be avoided for anything visible to extension modules, however.
      cd004067
  25. 21 1月, 2008 1 次提交
  26. 02 1月, 2008 1 次提交
  27. 16 11月, 2007 4 次提交
  28. 13 10月, 2007 1 次提交
    • T
      When telling the bgwriter that we need a checkpoint because too much xlog · 5c8eb929
      Tom Lane 提交于
      has been consumed, recheck against the latest value of RedoRecPtr before
      really sending the signal.  This avoids useless checkpoint activity if
      XLogWrite is executed when we have a very stale local copy of RedoRecPtr.
      The potential for useless checkpoint is very much worse in 8.3 because of
      the walwriter process (which never does XLogInsert), so while this behavior
      was intentional, it needs to be changed.  Per report from Itagaki Takahiro.
      5c8eb929
  29. 01 10月, 2007 1 次提交
  30. 30 9月, 2007 1 次提交
  31. 29 9月, 2007 1 次提交
  32. 27 9月, 2007 1 次提交
    • T
      Minor improvements in backup and recovery: · f18dfc48
      Tom Lane 提交于
      - create a separate archive_mode GUC, on which archive_command is dependent
      
      - %r option in recovery.conf sends last restartpoint to recovery command
      
      - %r used in pg_standby, updated README
      
      - minor other code cleanup in pg_standby
      
      - doc on Warm Standby now mentions pg_standby and %r
      
      - log_restartpoints recovery option emits LOG message at each restartpoint
      
      - end of recovery now displays last transaction end time, as requested
        by Warren Little; also shown at each restartpoint
      
      - restart archiver if needed to carry away WAL files at shutdown
      
      Simon Riggs
      f18dfc48