Skip to content
Snippets Groups Projects
  1. Feb 17, 2010
  2. Jan 02, 2010
  3. 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
  4. Nov 29, 2009
  5. Oct 17, 2009
  6. Jul 03, 2009
  7. Jun 26, 2009
  8. Jun 11, 2009
  9. Jun 04, 2009
    • Tom Lane's avatar
      Improve the recently-added support for properly pluralized error messages · 76d4abf2
      Tom Lane authored
      by extending the ereport() API to cater for pluralization directly.  This
      is better than the original method of calling ngettext outside the elog.c
      code because (1) it avoids double translation, which wastes cycles and in
      the worst case could give a wrong result; and (2) it avoids having to use
      a different coding method in PL code than in the core backend.  The
      client-side uses of ngettext are not touched since neither of these concerns
      is very pressing in the client environment.  Per my proposal of yesterday.
      76d4abf2
  10. Mar 02, 2009
    • Tom Lane's avatar
      When we are in error recursion trouble, arrange to suppress translation and · fd9e2acc
      Tom Lane authored
      encoding conversion of any elog/ereport message being sent to the frontend.
      This generalizes a patch that I put in last October, which suppressed
      translation of only specific messages known to be associated with recursive
      can't-translate-the-message behavior.  As shown in bug #4680, we need a more
      general answer in order to have some hope of coping with broken encoding
      conversion setups.  This approach seems a good deal less klugy anyway.
      
      Patch in all supported branches.
      fd9e2acc
  11. Jan 19, 2009
  12. Jan 07, 2009
  13. Jan 01, 2009
  14. Oct 27, 2008
    • Tom Lane's avatar
      Install a more robust solution for the problem of infinite error-processing · b0169bb1
      Tom Lane authored
      recursion when we are unable to convert a localized error message to the
      client's encoding.  We've been over this ground before, but as reported by
      Ibrar Ahmed, it still didn't work in the case of conversion failures for
      the conversion-failure message itself :-(.  Fix by installing a "circuit
      breaker" that disables attempts to localize this message once we get into
      recursion trouble.
      
      Patch all supported branches, because it is in fact broken in all of them;
      though I had to add some missing translations to the older branches in
      order to expose the failure in the particular test case I was using.
      b0169bb1
  15. Oct 18, 2008
  16. Oct 09, 2008
  17. Sep 01, 2008
  18. Jul 09, 2008
    • Tom Lane's avatar
      Increase PG_SYSLOG_LIMIT (the max line length sent to syslog()) from 128 to · 6b7eebc0
      Tom Lane authored
      1024 to improve performance when sending large elog messages.  Also add a
      comment about why we use that number.
      
      Since this represents an externally visible behavior change, and might
      possibly result in portability issues, it seems best not to back-patch it.
      6b7eebc0
    • Tom Lane's avatar
      Fix performance bug in write_syslog(): the code to preferentially break the · 37933102
      Tom Lane authored
      log message at newlines cost O(N^2) for very long messages with few or no
      newlines.  For messages in the megabyte range this became the dominant cost.
      Per gripe from Achilleas Mantzios.
      
      Patch all the way back, since this is a safe change with no portability
      risks.  I am also thinking of increasing PG_SYSLOG_LIMIT, but that should
      be done separately.
      37933102
  19. Mar 24, 2008
  20. Mar 10, 2008
    • Magnus Hagander's avatar
      Implement enum type for guc parameters, and convert a couple of existing · 52a8d4f8
      Magnus Hagander authored
      variables to it. More need to be converted, but I wanted to get this in
      before it conflicts with too much...
      
      Other than just centralising the text-to-int conversion for parameters,
      this allows the pg_settings view to contain a list of available options
      and allows an error hint to show what values are allowed.
      52a8d4f8
  21. Feb 19, 2008
  22. Jan 01, 2008
  23. Dec 11, 2007
  24. Nov 15, 2007
  25. Sep 27, 2007
  26. Sep 05, 2007
    • Tom Lane's avatar
      Implement lazy XID allocation: transactions that do not modify any database · 295e6398
      Tom Lane authored
      rows will normally never obtain an XID at all.  We already did things this way
      for subtransactions, but this patch extends the concept to top-level
      transactions.  In applications where there are lots of short read-only
      transactions, this should improve performance noticeably; not so much from
      removal of the actual XID-assignments, as from reduction of overhead that's
      driven by the rate of XID consumption.  We add a concept of a "virtual
      transaction ID" so that active transactions can be uniquely identified even
      if they don't have a regular XID.  This is a much lighter-weight concept:
      uniqueness of VXIDs is only guaranteed over the short term, and no on-disk
      record is made about them.
      
      Florian Pflug, with some editorialization by Tom.
      295e6398
  27. Aug 23, 2007
  28. Aug 19, 2007
  29. Aug 04, 2007
    • Tom Lane's avatar
      Fix crash caused by log_timezone patch if we attempt to emit any elog messages · 4fd8d6b3
      Tom Lane authored
      between the setting of log_line_prefix and the setting of log_timezone.  We
      can't realistically set log_timezone any earlier than we do now, so the best
      behavior seems to be to use GMT zone if any timestamps are to be logged during
      early startup.  Create a dummy zone variable with a minimal definition of GMT
      (in particular it will never know about leap seconds), so that we can set it
      up without reference to any external files.
      4fd8d6b3
    • Tom Lane's avatar
      Switch over to using the src/timezone functions for formatting timestamps · bdd6b622
      Tom Lane authored
      displayed in the postmaster log.  This avoids Windows-specific problems with
      localized time zone names that are in the wrong encoding, and generally seems
      like a good idea to forestall other potential platform-dependent issues.
      To preserve the existing behavior that all backends will log in the same time
      zone, create a new GUC variable log_timezone that can only be changed on a
      system-wide basis, and reference log-related calculations to that zone instead
      of the TimeZone variable.
      
      This fixes the issue reported by Hiroshi Saito that timestamps printed by
      xlog.c startup could be improperly localized on Windows.  We still need a
      simpler patch for that problem in the back branches, however.
      bdd6b622
  30. Aug 03, 2007
  31. Jul 22, 2007
    • Tom Lane's avatar
      Fix elog.c to avoid infinite recursion (leading to backend crash) when · a0dab332
      Tom Lane authored
      log_min_error_statement is active and there is some problem in logging the
      current query string; for example, that it's too long to include in the log
      message without running out of memory.  This problem has existed since the
      log_min_error_statement feature was introduced.  No doubt the reason it
      wasn't detected long ago is that 8.2 is the first release that defaults
      log_min_error_statement to less than PANIC level.
      Per report from Bill Moran.
      a0dab332
  32. Jul 19, 2007
  33. Jun 14, 2007
  34. Jun 07, 2007
    • Tom Lane's avatar
      Redefine IsTransactionState() to only return true for TRANS_INPROGRESS state, · 6d6d14b6
      Tom Lane authored
      which is the only state in which it's safe to initiate database queries.
      It turns out that all but two of the callers thought that's what it meant;
      and the other two were using it as a proxy for "will GetTopTransactionId()
      return a nonzero XID"?  Since it was in fact an unreliable guide to that,
      make those two just invoke GetTopTransactionId() always, then deal with a
      zero result if they get one.
      6d6d14b6
  35. May 04, 2007
    • Tom Lane's avatar
      A few fixups in error handling: mark pg_re_throw() as noreturn for gcc, · 79ca7ffe
      Tom Lane authored
      and for other compilers, insert a dummy exit() call so that they understand
      PG_RE_THROW() doesn't return.  Insert fflush(stderr) in ExceptionalCondition,
      per recent buildfarm evidence that that might not happen automatically on some
      platforms.  And const-ify ExceptionalCondition's declaration while at it.
      79ca7ffe
  36. May 02, 2007
    • Tom Lane's avatar
      Fix oversight in PG_RE_THROW processing: it's entirely possible that there · 88f1fd29
      Tom Lane authored
      isn't any place to throw the error to.  If so, we should treat the error
      as FATAL, just as we would have if it'd been thrown outside the PG_TRY
      block to begin with.
      
      Although this is clearly a *potential* source of bugs, it is not clear
      at the moment whether it is an *actual* source of bugs; there may not
      presently be any PG_TRY blocks in code that can be reached with no outer
      longjmp catcher.  So for the moment I'm going to be conservative and not
      back-patch this.  The change breaks ABI for users of PG_RE_THROW and hence
      might create compatibility problems for loadable modules, so we should not
      put it into released branches without proof that it's needed.
      88f1fd29
Loading