1. 03 6月, 2010 1 次提交
  2. 29 4月, 2010 3 次提交
    • T
      Minor editorializing on pg_controldata and pg_resetxlog: adjust some message · c80a85e3
      Tom Lane 提交于
      wording, deal explicitly with some fields that were being silently left zero.
      c80a85e3
    • T
      pg_controldata needs #define FRONTEND, same as pg_resetxlog. · 82e38aba
      Tom Lane 提交于
      Per buildfarm results from dawn_bat.
      82e38aba
    • H
      Introduce wal_level GUC to explicitly control if information needed for · 9b8a7332
      Heikki Linnakangas 提交于
      archival or hot standby should be WAL-logged, instead of deducing that from
      other options like archive_mode. This replaces recovery_connections GUC in
      the primary, where it now has no effect, but it's still used in the standby
      to enable/disable hot standby.
      
      Remove the WAL-logging of "unlogged operations", like creating an index
      without WAL-logging and fsyncing it at the end. Instead, we keep a copy of
      the wal_mode setting and the settings that affect how much shared memory a
      hot standby server needs to track master transactions (max_connections,
      max_prepared_xacts, max_locks_per_xact) in pg_control. Whenever the settings
      change, at server restart, write a WAL record noting the new settings and
      update pg_control. This allows us to notice the change in those settings in
      the standby at the right moment, they used to be included in checkpoint
      records, but that meant that a changed value was not reflected in the
      standby until the first checkpoint after the change.
      
      Bump PG_CONTROL_VERSION and XLOG_PAGE_MAGIC. Whack XLOG_PAGE_MAGIC back to
      the sequence it used to follow, before hot standby and subsequent patches
      changed it to 0x9003.
      9b8a7332
  3. 04 1月, 2010 1 次提交
    • H
      Write an end-of-backup WAL record at pg_stop_backup(), and wait for it at · 06f82b29
      Heikki Linnakangas 提交于
      recovery instead of reading the backup history file. This is more robust,
      as it stops you from prematurely starting up an inconsisten cluster if the
      backup history file is lost for some reason, or if the base backup was
      never finished with pg_stop_backup().
      
      This also paves the way for a simpler streaming replication patch, which
      doesn't need to care about backup history files anymore.
      
      The backup history file is still created and archived as before, but it's
      not used by the system anymore. It's just for informational purposes now.
      
      Bump PG_CONTROL_VERSION as the location of the backup startpoint is now
      written to a new field in pg_control, and catversion because initdb is
      required
      
      Original patch by Fujii Masao per Simon's idea, with further fixes by me.
      06f82b29
  4. 19 12月, 2009 1 次提交
    • S
      Allow read only connections during recovery, known as Hot Standby. · efc16ea5
      Simon Riggs 提交于
      Enabled by recovery_connections = on (default) and forcing archive recovery using a recovery.conf. Recovery processing now emulates the original transactions as they are replayed, providing full locking and MVCC behaviour for read only queries. Recovery must enter consistent state before connections are allowed, so there is a delay, typically short, before connections succeed. Replay of recovering transactions can conflict and in some cases deadlock with queries during recovery; these result in query cancellation after max_standby_delay seconds have expired. Infrastructure changes have minor effects on normal running, though introduce four new types of WAL record.
      
      New test mode "make standbycheck" allows regression tests of static command behaviour on a standby server while in recovery. Typical and extreme dynamic behaviours have been checked via code inspection and manual testing. Few port specific behaviours have been utilised, though primary testing has been on Linux only so far.
      
      This commit is the basic patch. Additional changes will follow in this release to enhance some aspects of behaviour, notably improved handling of conflicts, deadlock detection and query cancellation. Changes to VACUUM FULL are also required.
      
      Simon Riggs, with significant and lengthy review by Heikki Linnakangas, including streamlined redesign of snapshot creation and two-phase commit.
      
      Important contributions from Florian Pflug, Mark Kirkwood, Merlin Moncure, Greg Stark, Gianni Ciolli, Gabriele Bartolini, Hannu Krosing, Robert Haas, Tatsuo Ishii, Hiroyuki Yamada plus support and feedback from many other community members.
      efc16ea5
  5. 31 8月, 2009 1 次提交
    • T
      Track the current XID wrap limit (or more accurately, the oldest unfrozen · 25ec228e
      Tom Lane 提交于
      XID) in checkpoint records.  This eliminates the need to recompute the value
      from scratch during database startup, which is one of the two remaining
      reasons for the flatfile code to exist.  It should also simplify life for
      hot-standby operation.
      
      To avoid bloating the checkpoint records unreasonably, I switched from
      tracking the oldest database by name to tracking it by OID.  This turns
      out to save cycles in general (everywhere but the warning-generating
      paths, which we hardly care about) and also helps us deal with the case
      that the oldest database got dropped instead of being vacuumed.  The prior
      coding might go for a long time without updating the wrap limit in that case,
      which is bad because it might result in a lot of useless autovacuum activity.
      25ec228e
  6. 11 6月, 2009 1 次提交
  7. 11 12月, 2008 1 次提交
  8. 24 9月, 2008 1 次提交
  9. 23 9月, 2008 1 次提交
  10. 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
  11. 27 3月, 2008 1 次提交
    • T
      Reduce the need for frontend programs to include "postgres.h" by refactoring · 039dfbfd
      Tom Lane 提交于
      inclusions in src/include/catalog/*.h files.  The main idea here is to push
      function declarations for src/backend/catalog/*.c files into separate headers,
      rather than sticking them into the corresponding catalog definition file as
      has been done in the past.  This commit only carries out that idea fully for
      pg_proc, pg_type and pg_conversion, but that's enough for the moment ---
      if pg_list.h ever becomes unsafe for frontend code to include, we'll need
      to work a bit more.
      
      Zdenek Kotala
      039dfbfd
  12. 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
  13. 21 1月, 2008 1 次提交
  14. 03 4月, 2007 1 次提交
    • T
      Decouple the values of TOAST_TUPLE_THRESHOLD and TOAST_MAX_CHUNK_SIZE. · b3005276
      Tom Lane 提交于
      Add the latter to the values checked in pg_control, since it can't be changed
      without invalidating toast table content.  This commit in itself shouldn't
      change any behavior, but it lays some necessary groundwork for experimentation
      with these toast-control numbers.
      
      Note: while TOAST_TUPLE_THRESHOLD can now be changed without initdb, some
      thought still needs to be given to needs_toast_table() in toasting.c before
      unleashing random changes.
      b3005276
  15. 19 3月, 2007 1 次提交
  16. 04 3月, 2007 1 次提交
  17. 09 12月, 2006 1 次提交
    • T
      Remove the logId/logSeg fields from pg_control, because they are not needed · 0cb91ccb
      Tom Lane 提交于
      in normal operation, and we can avoid rewriting pg_control at every log
      segment switch if we don't insist that these values be valid.  Reducing
      the number of pg_control updates is a good idea for both performance and
      reliability.  It does make pg_resetxlog's life a bit harder, but that seems
      a good tradeoff; and anyway the change to pg_resetxlog amounts to automating
      something people formerly needed to do by hand, namely look at the existing
      pg_xlog files to make sure the new WAL start point was past them.
      
      In passing, change the wording of xlog.c's "database system was interrupted"
      messages: describe the pg_control timestamp as "last known up at" rather than
      implying it is the exact time of service interruption.  With this change the
      timestamp will generally be the time of the last checkpoint, which could be
      many minutes before the failure; and we've already seen indications that
      people tend to misinterpret the old wording.
      
      initdb forced due to change in pg_control layout.  Simon Riggs and Tom Lane
      0cb91ccb
  18. 22 8月, 2006 1 次提交
    • T
      Make the server track an 'XID epoch', that is, maintain higher-order bits · 35af5422
      Tom Lane 提交于
      of the transaction ID counter.  Nothing is done with the epoch except to
      store it in checkpoint records, but this provides a foundation with which
      add-on code can pretend that XIDs never wrap around.  This is a severely
      trimmed and rewritten version of the xxid patch submitted by Marko Kreen.
      Per discussion, the epoch counter seems the only part of xxid that really
      needs to be in the core server.
      35af5422
  19. 08 8月, 2006 1 次提交
    • T
      Make recovery from WAL be restartable, by executing a checkpoint-like · e0028369
      Tom Lane 提交于
      operation every so often.  This improves the usefulness of PITR log
      shipping for hot standby: formerly, if the standby server crashed, it
      was necessary to restart it from the last base backup and replay all
      the WAL since then.  Now it will only need to reread about the same
      amount of WAL as the master server would.  The behavior might also
      come in handy during a long PITR replay sequence.  Simon Riggs,
      with some editorialization by Tom Lane.
      e0028369
  20. 08 6月, 2006 1 次提交
    • B
      Prepare code to be built by MSVC: · 399a36a7
      Bruce Momjian 提交于
      	o  remove many WIN32_CLIENT_ONLY defines
      	o  add WIN32_ONLY_COMPILER define
      	o  add 3rd argument to open() for portability
      	o  add include/port/win32_msvc directory for
      	   system includes
      
      Magnus Hagander
      399a36a7
  21. 04 4月, 2006 1 次提交
    • T
      Define a separately configurable XLOG_BLCKSZ symbol for the page size · eaef1113
      Tom Lane 提交于
      used within WAL files.  Historically this was the same as the data file
      BLCKSZ, but there's no necessary connection, and it's possible that
      performance gains might ensue from reducing XLOG_BLCKSZ.  In any case
      distinguishing two symbols should improve code clarity.  This commit
      does not actually change the page size, only provide the infrastructure
      to make it possible to do so.  initdb forced because of addition of a
      field to pg_control.
      Mark Wong, with some help from Simon Riggs and Tom Lane.
      eaef1113
  22. 15 10月, 2005 1 次提交
  23. 03 10月, 2005 1 次提交
  24. 08 6月, 2005 1 次提交
  25. 02 6月, 2005 1 次提交
    • T
      Change CRCs in WAL records from 64bit to 32bit for performance reasons. · 21fda22e
      Tom Lane 提交于
      Instead of a separate CRC on each backup block, include backup blocks
      in their parent WAL record's CRC; this is important to ensure that the
      backup block really goes with the WAL record, ie there was not a page
      tear right at the start of the backup block.  Implement a simple form
      of compression of backup blocks: drop any run of zeroes starting at
      pd_lower, so as not to store the unused 'hole' that commonly exists in
      PG heap and index pages.  Tweak PageRepairFragmentation and related
      routines to ensure they keep the unused space zeroed, so that the above
      compression method remains effective.  All per recent discussions.
      21fda22e
  26. 29 4月, 2005 1 次提交
    • T
      Implement sharable row-level locks, and use them for foreign key references · bedb78d3
      Tom Lane 提交于
      to eliminate unnecessary deadlocks.  This commit adds SELECT ... FOR SHARE
      paralleling SELECT ... FOR UPDATE.  The implementation uses a new SLRU
      data structure (managed much like pg_subtrans) to represent multiple-
      transaction-ID sets.  When more than one transaction is holding a shared
      lock on a particular row, we create a MultiXactId representing that set
      of transactions and store its ID in the row's XMAX.  This scheme allows
      an effectively unlimited number of row locks, just as we did before,
      while not costing any extra overhead except when a shared lock actually
      has to be shared.   Still TODO: use the regular lock manager to control
      the grant order when multiple backends are waiting for a row lock.
      
      Alvaro Herrera and Tom Lane.
      bedb78d3
  27. 29 3月, 2005 1 次提交
  28. 22 2月, 2005 1 次提交
  29. 23 9月, 2004 1 次提交
  30. 29 8月, 2004 1 次提交
  31. 22 7月, 2004 1 次提交
    • T
      Invent WAL timelines, as per recent discussion, to make point-in-time · 2042b342
      Tom Lane 提交于
      recovery more manageable.  Also, undo recent change to add FILE_HEADER
      and WASTED_SPACE records to XLOG; instead make the XLOG page header
      variable-size with extra fields in the first page of an XLOG file.
      This should fix the boundary-case bugs observed by Mark Kirkwood.
      initdb forced due to change of XLOG representation.
      2042b342
  32. 03 6月, 2004 1 次提交
    • B
      Add PGETC (for pg_service.conf) and PGLOCALE (for locale dir) · 68708433
      Bruce Momjian 提交于
      environment variable processing to libpq.
      
      The patch also adds code to our client apps so we set the environment
      variable directly based on our binary location, unless it is already
      set. This will allow our applications to emit proper locale messages
      that are generated in libpq.
      68708433
  33. 25 5月, 2004 1 次提交
  34. 12 5月, 2004 1 次提交
    • B
      Rename find_my_binary/find_other_binary to · b1ffacdd
      Bruce Momjian 提交于
      find_my_exec/find_other_exec().  Remove passing of progname to these
      functions as they can find that out from argv[0], which they already
      have.
      
      Make get_progname return const char *, and update all progname variables
      to be const char *.
      b1ffacdd
  35. 22 3月, 2004 1 次提交
  36. 12 2月, 2004 1 次提交
    • T
      Commit the reasonably uncontroversial parts of J.R. Nield's PITR patch, to · c3c09be3
      Tom Lane 提交于
      wit: Add a header record to each WAL segment file so that it can be reliably
      identified.  Avoid splitting WAL records across segment files (this is not
      strictly necessary, but makes it simpler to incorporate the header records).
      Make WAL entries for file creation, deletion, and truncation (as foreseen but
      never implemented by Vadim).  Also, add support for making XLOG_SEG_SIZE
      configurable at compile time, similarly to BLCKSZ.  Fix a couple bugs I
      introduced in WAL replay during recent smgr API changes.  initdb is forced
      due to changes in pg_control contents.
      c3c09be3
  37. 30 11月, 2003 1 次提交
    • P
      · 969685ad
      PostgreSQL Daemon 提交于
      $Header: -> $PostgreSQL Changes ...
      969685ad
  38. 04 8月, 2003 1 次提交