1. 19 7月, 2011 1 次提交
  2. 18 7月, 2011 1 次提交
  3. 08 7月, 2011 1 次提交
  4. 04 7月, 2011 1 次提交
    • H
      Remove silent_mode. You get the same functionality with "pg_ctl -l · f7ea6bea
      Heikki Linnakangas 提交于
      postmaster.log", or nohup.
      
      There was a small issue with LINUX_OOM_ADJ and silent_mode, namely that with
      silent_mode the postmaster process incorrectly used the OOM settings meant
      for backend processes. We certainly could've fixed that directly, but since
      silent_mode was redundant anyway, we might as well just remove it.
      f7ea6bea
  5. 11 5月, 2011 1 次提交
  6. 05 4月, 2011 1 次提交
  7. 30 3月, 2011 1 次提交
    • H
      Automatically terminate replication connections that are idle for more · 754baa21
      Heikki Linnakangas 提交于
      than replication_timeout (a new GUC) milliseconds. The TCP timeout is often
      too long, you want the master to notice a dead connection much sooner.
      People complained about that in 9.0 too, but with synchronous replication
      it's even more important to notice dead connections promptly.
      
      Fujii Masao and Heikki Linnakangas
      754baa21
  8. 07 3月, 2011 1 次提交
    • S
      Efficient transaction-controlled synchronous replication. · a8a8a3e0
      Simon Riggs 提交于
      If a standby is broadcasting reply messages and we have named
      one or more standbys in synchronous_standby_names then allow
      users who set synchronous_replication to wait for commit, which
      then provides strict data integrity guarantees. Design avoids
      sending and receiving transaction state information so minimises
      bookkeeping overheads. We synchronize with the highest priority
      standby that is connected and ready to synchronize. Other standbys
      can be defined to takeover in case of standby failure.
      
      This version has very strict behaviour; more relaxed options
      may be added at a later date.
      
      Simon Riggs and Fujii Masao, with reviews by Yeb Havinga, Jaime
      Casanova, Heikki Linnakangas and Robert Haas, plus the assistance
      of many other design reviewers.
      a8a8a3e0
  9. 27 2月, 2011 1 次提交
  10. 17 2月, 2011 1 次提交
    • S
      Hot Standby feedback for avoidance of cleanup conflicts on standby. · bca8b7f1
      Simon Riggs 提交于
      Standby optionally sends back information about oldestXmin of queries
      which is then checked and applied to the WALSender's proc->xmin.
      GetOldestXmin() is modified slightly to agree with GetSnapshotData(),
      so that all backends on primary include WALSender within their snapshots.
      Note this does nothing to change the snapshot xmin on either master or
      standby. Feedback piggybacks on the standby reply message.
      vacuum_defer_cleanup_age is no longer used on standby, though parameter
      still exists on primary, since some use cases still exist.
      
      Simon Riggs, review comments from Fujii Masao, Heikki Linnakangas, Robert Haas
      bca8b7f1
  11. 15 2月, 2011 1 次提交
  12. 11 2月, 2011 1 次提交
    • H
      Send status updates back from standby server to master, indicating how far · b186523f
      Heikki Linnakangas 提交于
      the standby has written, flushed, and applied the WAL. At the moment, this
      is for informational purposes only, the values are only shown in
      pg_stat_replication system view, but in the future they will also be needed
      for synchronous replication.
      
      Extracted from Simon riggs' synchronous replication patch by Robert Haas, with
      some tweaking by me.
      b186523f
  13. 08 2月, 2011 1 次提交
    • H
      Implement genuine serializable isolation level. · dafaa3ef
      Heikki Linnakangas 提交于
      Until now, our Serializable mode has in fact been what's called Snapshot
      Isolation, which allows some anomalies that could not occur in any
      serialized ordering of the transactions. This patch fixes that using a
      method called Serializable Snapshot Isolation, based on research papers by
      Michael J. Cahill (see README-SSI for full references). In Serializable
      Snapshot Isolation, transactions run like they do in Snapshot Isolation,
      but a predicate lock manager observes the reads and writes performed and
      aborts transactions if it detects that an anomaly might occur. This method
      produces some false positives, ie. it sometimes aborts transactions even
      though there is no anomaly.
      
      To track reads we implement predicate locking, see storage/lmgr/predicate.c.
      Whenever a tuple is read, a predicate lock is acquired on the tuple. Shared
      memory is finite, so when a transaction takes many tuple-level locks on a
      page, the locks are promoted to a single page-level lock, and further to a
      single relation level lock if necessary. To lock key values with no matching
      tuple, a sequential scan always takes a relation-level lock, and an index
      scan acquires a page-level lock that covers the search key, whether or not
      there are any matching keys at the moment.
      
      A predicate lock doesn't conflict with any regular locks or with another
      predicate locks in the normal sense. They're only used by the predicate lock
      manager to detect the danger of anomalies. Only serializable transactions
      participate in predicate locking, so there should be no extra overhead for
      for other transactions.
      
      Predicate locks can't be released at commit, but must be remembered until
      all the transactions that overlapped with it have completed. That means that
      we need to remember an unbounded amount of predicate locks, so we apply a
      lossy but conservative method of tracking locks for committed transactions.
      If we run short of shared memory, we overflow to a new "pg_serial" SLRU
      pool.
      
      We don't currently allow Serializable transactions in Hot Standby mode.
      That would be hard, because even read-only transactions can cause anomalies
      that wouldn't otherwise occur.
      
      Serializable isolation mode now means the new fully serializable level.
      Repeatable Read gives you the old Snapshot Isolation level that we have
      always had.
      
      Kevin Grittner and Dan Ports, reviewed by Jeff Davis, Heikki Linnakangas and
      Anssi Kääriäinen
      dafaa3ef
  14. 23 1月, 2011 1 次提交
    • T
      Allow the wal_buffers setting to be auto-tuned to a reasonable value. · 0f73aae1
      Tom Lane 提交于
      If wal_buffers is initially set to -1 (which is now the default), it's
      replaced by 1/32nd of shared_buffers, with a minimum of 8 (the old default)
      and a maximum of the XLOG segment size.  The allowed range for manual
      settings is still from 4 up to whatever will fit in shared memory.
      
      Greg Smith, with implementation correction by me.
      0f73aae1
  15. 09 12月, 2010 1 次提交
    • T
      Force default wal_sync_method to be fdatasync on Linux. · 576477e7
      Tom Lane 提交于
      Recent versions of the Linux system header files cause xlogdefs.h to
      believe that open_datasync should be the default sync method, whereas
      formerly fdatasync was the default on Linux.  open_datasync is a bad
      choice, first because it doesn't actually outperform fdatasync (in fact
      the reverse), and second because we try to use O_DIRECT with it, causing
      failures on certain filesystems (e.g., ext4 with data=journal option).
      This part of the patch is largely per a proposal from Marti Raudsepp.
      More extensive changes are likely to follow in HEAD, but this is as much
      change as we want to back-patch.
      
      Also clean up confusing code and incorrect documentation surrounding the
      fsync_writethrough option.  Those changes shouldn't result in any actual
      behavioral change, but I chose to back-patch them anyway to keep the
      branches looking similar in this area.
      
      In 9.0 and HEAD, also do some copy-editing on the WAL Reliability
      documentation section.
      
      Back-patch to all supported branches, since any of them might get used
      on modern Linux versions.
      576477e7
  16. 24 11月, 2010 1 次提交
  17. 09 10月, 2010 1 次提交
  18. 27 9月, 2010 1 次提交
  19. 28 7月, 2010 1 次提交
  20. 22 7月, 2010 1 次提交
    • R
      Add options to force quoting of all identifiers. · ce68df46
      Robert Haas 提交于
      I've added a quote_all_identifiers GUC which affects the behavior
      of the backend, and a --quote-all-identifiers argument to pg_dump
      and pg_dumpall which sets the GUC and also affects the quoting done
      internally by those applications.
      
      Design by Tom Lane; review by Alex Hunsaker; in response to bug #5488
      filed by Hartmut Goebel.
      ce68df46
  21. 20 7月, 2010 2 次提交
    • R
      Add restart_after_crash GUC. · 5ffaa900
      Robert Haas 提交于
      Normally, we automatically restart after a backend crash, but in some
      cases when PostgreSQL is invoked by clusterware it may be desirable to
      suppress this behavior, so we provide an option which does this.
      Since no existing GUC group quite fits, create a new group called
      "error handling options" for this and the previously undocumented GUC
      exit_on_error, which is now documented.
      
      Review by Fujii Masao.
      5ffaa900
    • R
      Change the default value of standard_conforming_strings to on. · 0839f312
      Robert Haas 提交于
      This change should be publicized to driver maintainers at once and
      release-noted as an incompatibility with previous releases.
      0839f312
  22. 17 7月, 2010 1 次提交
  23. 04 7月, 2010 2 次提交
    • T
      Make vacuum_defer_cleanup_age be PGC_SIGHUP level, since it's not sensible · aceedd88
      Tom Lane 提交于
      to have different values in different processes of the primary server.
      Also put it into the "Streaming Replication" GUC category; it doesn't belong
      in "Standby Servers" because you use it on the master not the standby.
      In passing also correct guc.c's idea of wal_keep_segments' category.
      aceedd88
    • T
      Replace max_standby_delay with two parameters, max_standby_archive_delay and · e76c1a0f
      Tom Lane 提交于
      max_standby_streaming_delay, and revise the implementation to avoid assuming
      that timestamps found in WAL records can meaningfully be compared to clock
      time on the standby server.  Instead, the delay limits are compared to the
      elapsed time since we last obtained a new WAL segment from archive or since
      we were last "caught up" to WAL data arriving via streaming replication.
      This avoids problems with clock skew between primary and standby, as well
      as other corner cases that the original coding would misbehave in, such
      as the primary server having significant idle time between transactions.
      Per my complaint some time ago and considerable ensuing discussion.
      
      Do some desultory editing on the hot standby documentation, too.
      e76c1a0f
  24. 15 6月, 2010 1 次提交
  25. 02 5月, 2010 1 次提交
    • T
      Clean up some awkward, inaccurate, and inefficient processing around · f9ed327f
      Tom Lane 提交于
      MaxStandbyDelay.  Use the GUC units mechanism for the value, and choose more
      appropriate timestamp functions for performing tests with it.  Make the
      ps_activity manipulation in ResolveRecoveryConflictWithVirtualXIDs have
      behavior similar to ps_activity code elsewhere, notably not updating the
      display when update_process_title is off and not truncating the display
      contents at an arbitrarily-chosen length.  Improve the docs to be explicit
      about what MaxStandbyDelay actually measures, viz the difference between
      primary and standby servers' clocks, and the possible hazards if their clocks
      aren't in sync.
      f9ed327f
  26. 30 4月, 2010 1 次提交
  27. 29 4月, 2010 1 次提交
    • 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
  28. 20 4月, 2010 1 次提交
  29. 19 4月, 2010 1 次提交
    • R
      Add an 'enable_material' GUC. · 5b89ef38
      Robert Haas 提交于
      The logic for determining whether to materialize has been significantly
      overhauled for 9.0.  In case there should be any doubt about whether
      materialization is a win in any particular case, this should provide a
      convenient way of seeing what happens without it; but even with enable_material
      turned off, we still materialize in cases where it is required for
      correctness.
      
      Thanks to Tom Lane for the review.
      5b89ef38
  30. 12 4月, 2010 1 次提交
    • H
      Change the logic to decide when to delete old WAL segments, so that it · e57cd7f0
      Heikki Linnakangas 提交于
      doesn't take into account how far the WAL senders are. This way a hung
      WAL sender doesn't prevent old WAL segments from being recycled/removed
      in the primary, ultimately causing the disk to fill up. Instead add
      standby_keep_segments setting to control how many old WAL segments are
      kept in the primary. This also makes it more reliable to use streaming
      replication without WAL archiving, assuming that you set
      standby_keep_segments high enough.
      e57cd7f0
  31. 30 3月, 2010 1 次提交
  32. 24 3月, 2010 1 次提交
  33. 18 3月, 2010 1 次提交
  34. 25 2月, 2010 1 次提交
  35. 17 2月, 2010 1 次提交
  36. 01 2月, 2010 1 次提交
  37. 30 1月, 2010 1 次提交
    • S
      Augment WAL records for btree delete with GetOldestXmin() to reduce · 6d2bc0a6
      Simon Riggs 提交于
      false positives during Hot Standby conflict processing. Simple
      patch to enhance conflict processing, following previous discussions.
      Controlled by parameter minimize_standby_conflicts = on | off, with
      default off allows measurement of performance impact to see whether
      it should be set on all the time.
      6d2bc0a6
  38. 27 1月, 2010 1 次提交
    • T
      Remove the default_do_language parameter, instead making DO use a hardwired · d879697c
      Tom Lane 提交于
      default of "plpgsql".  This is more reasonable than it was when the DO patch
      was written, because we have since decided that plpgsql should be installed
      by default.  Per discussion, having a parameter for this doesn't seem useful
      enough to justify the risk of application breakage if the value is changed
      unexpectedly.
      d879697c