1. 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
  2. 06 8月, 2010 1 次提交
  3. 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
  4. 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
  5. 17 7月, 2010 1 次提交
  6. 07 7月, 2010 2 次提交
  7. 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
  8. 25 6月, 2010 1 次提交
  9. 18 6月, 2010 1 次提交
  10. 15 6月, 2010 1 次提交
  11. 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
  12. 30 4月, 2010 1 次提交
  13. 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
  14. 23 4月, 2010 1 次提交
  15. 22 4月, 2010 1 次提交
    • T
      Enforce superuser permissions checks during ALTER ROLE/DATABASE SET, rather · a6dcd19a
      Tom Lane 提交于
      than during define_custom_variable().  This entails rejecting an ALTER
      command if the target variable doesn't have a known (non-placeholder)
      definition, unless the calling user is superuser.  When the variable *is*
      known, we can correctly apply the rule that only superusers can issue ALTER
      for SUSET parameters.  This allows define_custom_variable to apply ALTER's
      values for SUSET parameters at module load time, secure in the knowledge
      that only a superuser could have set the ALTER value.  This change fixes a
      longstanding gotcha in the usage of SUSET-level custom parameters; which
      is a good thing to fix now that plpgsql defines such a parameter.
      a6dcd19a
  16. 20 4月, 2010 1 次提交
  17. 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
  18. 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
  19. 01 4月, 2010 1 次提交
    • R
      Refer to max_wal_senders in a more consistent fashion. · 54943734
      Robert Haas 提交于
      The error message now makes explicit reference to the GUC that must be changed
      to fix the problem, using wording suggested by Tom Lane.  Along the way,
      rename the GUC from MaxWalSenders to max_wal_senders for consistency and
      grep-ability.
      54943734
  20. 25 3月, 2010 1 次提交
  21. 21 3月, 2010 1 次提交
  22. 26 2月, 2010 1 次提交
  23. 25 2月, 2010 1 次提交
  24. 17 2月, 2010 2 次提交
  25. 13 2月, 2010 1 次提交
    • S
      Re-enable max_standby_delay = -1 using deadlock detection on startup · b95a720a
      Simon Riggs 提交于
      process. If startup waits on a buffer pin we send a request to all
      backends to cancel themselves if they are holding the buffer pin
      required and they are also waiting on a lock. If not, startup waits
      until max_standby_delay before cancelling any backend waiting for
      the requested buffer pin.
      b95a720a
  26. 01 2月, 2010 1 次提交
  27. 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
  28. 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
  29. 25 1月, 2010 1 次提交
    • T
      Fix assorted core dumps and Assert failures that could occur during · 875353b9
      Tom Lane 提交于
      AbortTransaction or AbortSubTransaction, when trying to clean up after an
      error that prevented (sub)transaction start from completing:
      * access to TopTransactionResourceOwner that might not exist
      * assert failure in AtEOXact_GUC, if AtStart_GUC not called yet
      * assert failure or core dump in AfterTriggerEndSubXact, if
        AfterTriggerBeginSubXact not called yet
      
      Per testing by injecting elog(ERROR) at successive steps in StartTransaction
      and StartSubTransaction.  It's not clear whether all of these cases could
      really occur in the field, but at least one of them is easily exposed by
      simple stress testing, as per my accidental discovery yesterday.
      875353b9
  30. 24 1月, 2010 1 次提交
    • S
      In HS, Startup process sets SIGALRM when waiting for buffer pin. If · 959ac58c
      Simon Riggs 提交于
      woken by alarm we send SIGUSR1 to all backends requesting that they
      check to see if they are blocking Startup process. If so, they throw
      ERROR/FATAL as for other conflict resolutions. Deadlock stop gap
      removed. max_standby_delay = -1 option removed to prevent deadlock.
      959ac58c
  31. 15 1月, 2010 1 次提交
    • H
      Introduce Streaming Replication. · 40f908bd
      Heikki Linnakangas 提交于
      This includes two new kinds of postmaster processes, walsenders and
      walreceiver. Walreceiver is responsible for connecting to the primary server
      and streaming WAL to disk, while walsender runs in the primary server and
      streams WAL from disk to the client.
      
      Documentation still needs work, but the basics are there. We will probably
      pull the replication section to a new chapter later on, as well as the
      sections describing file-based replication. But let's do that as a separate
      patch, so that it's easier to see what has been added/changed. This patch
      also adds a new section to the chapter about FE/BE protocol, documenting the
      protocol used by walsender/walreceivxer.
      
      Bump catalog version because of two new functions,
      pg_last_xlog_receive_location() and pg_last_xlog_replay_location(), for
      monitoring the progress of replication.
      
      Fujii Masao, with additional hacking by me
      40f908bd
  32. 07 1月, 2010 1 次提交
  33. 03 1月, 2010 1 次提交
  34. 01 1月, 2010 1 次提交
  35. 21 12月, 2009 1 次提交
  36. 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