Skip to content
Snippets Groups Projects
  1. Aug 30, 2010
  2. Aug 13, 2010
  3. Jul 06, 2010
  4. Jul 03, 2010
    • Tom Lane's avatar
      Make vacuum_defer_cleanup_age be PGC_SIGHUP level, since it's not sensible · aceedd88
      Tom Lane authored
      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
  5. May 14, 2010
  6. May 13, 2010
    • Simon Riggs's avatar
      Cleanup initialization of Hot Standby. Clarify working with reanalysis · 8431e296
      Simon Riggs authored
      of requirements and documentation on LogStandbySnapshot(). Fixes
      two minor bugs reported by Tom Lane that would lead to an incorrect
      snapshot after transaction wraparound. Also fix two other problems
      discovered that would give incorrect snapshots in certain cases.
      ProcArrayApplyRecoveryInfo() substantially rewritten. Some minor
      refactoring of xact_redo_apply() and ExpireTreeKnownAssignedTransactionIds().
      8431e296
  7. Apr 29, 2010
  8. Apr 28, 2010
  9. Apr 22, 2010
  10. Apr 21, 2010
    • Simon Riggs's avatar
      Relax locking during GetCurrentVirtualXIDs(). Earlier improvements · 0192abc4
      Simon Riggs authored
      to handling of btree delete records mean that all snapshot
      conflicts on standby now have a valid, useful latestRemovedXid.
      Our earlier approach using LW_EXCLUSIVE was useful when we didnt
      always have a valid value, though is no longer useful or necessary.
      Asserts added to code path to prove and ensure this is the case.
      This will reduce contention and improve performance of larger Hot
      Standby servers.
      0192abc4
  11. Apr 19, 2010
  12. Apr 18, 2010
  13. Apr 06, 2010
  14. Mar 11, 2010
  15. Feb 26, 2010
  16. Jan 23, 2010
  17. Jan 21, 2010
  18. Jan 16, 2010
    • Tom Lane's avatar
      Fix bogus initialization of KnownAssignedXids shared memory state --- · e319e679
      Tom Lane authored
      didn't work in EXEC_BACKEND case.
      e319e679
    • Simon Riggs's avatar
      Teach standby conflict resolution to use SIGUSR1 · a8ce974c
      Simon Riggs authored
      Conflict reason is passed through directly to the backend, so we can
      take decisions about the effect of the conflict based upon the local
      state. No specific changes, as yet, though this prepares for later work.
      CancelVirtualTransaction() sends signals while holding ProcArrayLock.
      Introduce errdetail_abort() to give message detail explaining that the
      abort was caused by conflict processing. Remove CONFLICT_MODE states
      in favour of using PROCSIG_RECOVERY_CONFLICT states directly, for clarity.
      a8ce974c
  19. Jan 10, 2010
    • Simon Riggs's avatar
      During Hot Standby, fix drop database when sessions idle. · 3bfcccc2
      Simon Riggs authored
      Previously we only cancelled sessions that were in-transaction.
      
      Simple fix is to just cancel all sessions without waiting. Doing
      it this way avoids complicating common code paths, which would
      not be worth the trouble to cover this rare case.
      
      Problem report and fix by Andres Freund, edited somewhat by me
      3bfcccc2
  20. Jan 02, 2010
  21. Dec 31, 2009
  22. Dec 19, 2009
    • Simon Riggs's avatar
      Allow read only connections during recovery, known as Hot Standby. · efc16ea5
      Simon Riggs authored
      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
  23. Jul 29, 2009
  24. Jun 11, 2009
  25. Apr 04, 2009
    • Tom Lane's avatar
      A session that does not have any live snapshots does not have to be waited for · c973051a
      Tom Lane authored
      when we are waiting for old snapshots to go away during a concurrent index
      build.  In particular, this rule lets us avoid waiting for
      idle-in-transaction sessions.
      
      This logic could be improved further if we had some way to wake up when
      the session we are currently waiting for goes idle-in-transaction.  However
      that would be a significantly more complex/invasive patch, so it'll have to
      wait for some other day.
      
      Simon Riggs, with some improvements by Tom.
      c973051a
  26. Mar 31, 2009
    • Heikki Linnakangas's avatar
      Fix a rare race condition when commit_siblings > 0 and a transaction commits · eeeb782e
      Heikki Linnakangas authored
      at the same instant as a new backend is spawned. Since CountActiveBackends()
      doesn't hold ProcArrayLock, it needs to be prepared for the case that a
      pointer at the end of the proc array is still NULL even though numProcs says
      it should be valid, since it doesn't hold ProcArrayLock. Backpatch to 8.1.
      8.0 and earlier had this right, but it was broken in the split of PGPROC and
      sinval shared memory arrays.
      
      Per report and proposal by Marko Kreen.
      eeeb782e
  27. Jan 01, 2009
  28. Aug 04, 2008
    • Tom Lane's avatar
      Improve CREATE/DROP/RENAME DATABASE so that when failing because the source · 4abd7b49
      Tom Lane authored
      or target database is being accessed by other users, it tells you whether
      the "other users" are live sessions or uncommitted prepared transactions.
      (Indeed, it tells you exactly how many of each, but that's mostly just
      because it was easy to do so.)  This should help forestall the gotcha of
      not realizing that a prepared transaction is what's blocking the command.
      Per discussion.
      4abd7b49
  29. Jul 11, 2008
  30. May 12, 2008
    • Alvaro Herrera's avatar
      Improve snapshot manager by keeping explicit track of snapshots. · 5da9da71
      Alvaro Herrera authored
      There are two ways to track a snapshot: there's the "registered" list, which
      is used for arbitrary long-lived snapshots; and there's the "active stack",
      which is used for the snapshot that is considered "active" at any time.
      This also allows users of snapshots to stop worrying about snapshot memory
      allocation and freeing, and about using PG_TRY blocks around ActiveSnapshot
      assignment.  This is all done automatically now.
      
      As a consequence, this allows us to reset MyProc->xmin when there are no
      more snapshots registered in the current backend, reducing the impact that
      long-running transactions have on VACUUM.
      5da9da71
  31. Mar 26, 2008
  32. Mar 11, 2008
    • Tom Lane's avatar
      Make TransactionIdIsInProgress check transam.c's single-item XID status cache · 611b4393
      Tom Lane authored
      before it goes groveling through the ProcArray.  In situations where the same
      recently-committed transaction ID is checked repeatedly by tqual.c, this saves
      a lot of shared-memory searches.  And it's cheap enough that it shouldn't
      hurt noticeably when it doesn't help.
      Concept and patch by Simon, some minor tweaking and comment-cleanup by Tom.
      611b4393
  33. Jan 09, 2008
  34. Jan 01, 2008
  35. Nov 30, 2007
    • Tom Lane's avatar
      Avoid incrementing the CommandCounter when CommandCounterIncrement is called · 895a94de
      Tom Lane authored
      but no database changes have been made since the last CommandCounterIncrement.
      This should result in a significant improvement in the number of "commands"
      that can typically be performed within a transaction before hitting the 2^32
      CommandId size limit.  In particular this buys back (and more) the possible
      adverse consequences of my previous patch to fix plan caching behavior.
      
      The implementation requires tracking whether the current CommandCounter
      value has been "used" to mark any tuples.  CommandCounter values stored into
      snapshots are presumed not to be used for this purpose.  This requires some
      small executor changes, since the executor used to conflate the curcid of
      the snapshot it was using with the command ID to mark output tuples with.
      Separating these concepts allows some small simplifications in executor APIs.
      
      Something for the TODO list: look into having CommandCounterIncrement not do
      AcceptInvalidationMessages.  It seems fairly bogus to be doing it there,
      but exactly where to do it instead isn't clear, and I'm disinclined to mess
      with asynchronous behavior during late beta.
      895a94de
  36. Nov 15, 2007
  37. Oct 24, 2007
Loading