Skip to content
Snippets Groups Projects
  1. Jan 02, 2012
  2. Nov 02, 2011
  3. Nov 01, 2011
    • Simon Riggs's avatar
      Split work of bgwriter between 2 processes: bgwriter and checkpointer. · 806a2aee
      Simon Riggs authored
      bgwriter is now a much less important process, responsible for page
      cleaning duties only. checkpointer is now responsible for checkpoints
      and so has a key role in shutdown. Later patches will correct doc
      references to the now old idea that bgwriter performs checkpoints.
      Has beneficial effect on performance at high write rates, but mainly
      refactoring to more easily allow changes for power reduction by
      simplifying previously tortuous code around required to allow page
      cleaning and checkpointing to time slice in the same process.
      
      Patch by me, Review by Dickson Guedes
      806a2aee
  4. Sep 01, 2011
  5. Jul 08, 2011
    • Heikki Linnakangas's avatar
      Introduce a pipe between postmaster and each backend, which can be used to · 89fd72cb
      Heikki Linnakangas authored
      detect postmaster death. Postmaster keeps the write-end of the pipe open,
      so when it dies, children get EOF in the read-end. That can conveniently
      be waited for in select(), which allows eliminating some of the polling
      loops that check for postmaster death. This patch doesn't yet change all
      the loops to use the new mechanism, expect a follow-on patch to do that.
      
      This changes the interface to WaitLatch, so that it takes as argument a
      bitmask of events that it waits for. Possible events are latch set, timeout,
      postmaster death, and socket becoming readable or writeable.
      
      The pipe method behaves slightly differently from the kill() method
      previously used in PostmasterIsAlive() in the case that postmaster has died,
      but its parent has not yet read its exit code with waitpid(). The pipe
      returns EOF as soon as the process dies, but kill() continues to return
      true until waitpid() has been called (IOW while the process is a zombie).
      Because of that, change PostmasterIsAlive() to use the pipe too, otherwise
      WaitLatch() would return immediately with WL_POSTMASTER_DEATH, while
      PostmasterIsAlive() would claim it's still alive. That could easily lead to
      busy-waiting while postmaster is in zombie state.
      
      Peter Geoghegan with further changes by me, reviewed by Fujii Masao and
      Florian Pflug.
      89fd72cb
  6. Jul 04, 2011
  7. Jan 01, 2011
  8. Sep 20, 2010
  9. Aug 13, 2010
    • Robert Haas's avatar
      Include the backend ID in the relpath of temporary relations. · debcec7d
      Robert Haas authored
      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
  10. Jul 20, 2010
    • Robert Haas's avatar
      Add restart_after_crash GUC. · 5ffaa900
      Robert Haas authored
      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
  11. Jul 17, 2010
  12. Feb 26, 2010
  13. Jan 02, 2010
  14. Sep 08, 2009
    • Tom Lane's avatar
      Add a boolean GUC parameter "bonjour" to control whether a Bonjour-enabled · eeb6cb14
      Tom Lane authored
      build actually attempts to advertise itself via Bonjour.  Formerly it always
      did so, which meant that packagers had to decide for their users whether
      this behavior was wanted or not.  The default is "off" to be on the safe
      side, though this represents a change in the default behavior of a
      Bonjour-enabled build.  Per discussion.
      eeb6cb14
  15. Aug 31, 2009
    • Tom Lane's avatar
      Change the autovacuum launcher to read pg_database directly, rather than · 00e6a16d
      Tom Lane authored
      via the "flat files" facility.  This requires making it enough like a backend
      to be able to run transactions; it's no longer an "auxiliary process" but
      more like the autovacuum worker processes.  Also, its signal handling has
      to be brought into line with backends/workers.  In particular, since it
      now has to handle procsignal.c processing, the special autovac-launcher-only
      signal conditions are moved to SIGUSR2.
      
      Alvaro, with some cleanup from Tom
      00e6a16d
  16. Jun 11, 2009
  17. May 05, 2009
    • Tom Lane's avatar
      Install a "dead man switch" to allow the postmaster to detect cases where · 969d7cd4
      Tom Lane authored
      a backend has done exit(0) or exit(1) without having disengaged itself
      from shared memory.  We are at risk for this whenever third-party code is
      loaded into a backend, since such code might not know it's supposed to go
      through proc_exit() instead.  Also, it is reported that under Windows
      there are ways to externally kill a process that cause the status code
      returned to the postmaster to be indistinguishable from a voluntary exit
      (thank you, Microsoft).  If this does happen then the system is probably
      hosed --- for instance, the dead session might still be holding locks.
      So the best recovery method is to treat this like a backend crash.
      
      The dead man switch is armed for a particular child process when it
      acquires a regular PGPROC, and disarmed when the PGPROC is released;
      these should be the first and last touches of shared memory resources
      in a backend, or close enough anyway.  This choice means there is no
      coverage for auxiliary processes, but I doubt we need that, since they
      shouldn't be executing any user-provided code anyway.
      
      This patch also improves the management of the EXEC_BACKEND
      ShmemBackendArray array a bit, by reducing search costs.
      
      Although this problem is of long standing, the lack of field complaints
      seems to mean it's not critical enough to risk back-patching; at least
      not till we get some more testing of this mechanism.
      969d7cd4
  18. Jan 01, 2009
  19. Aug 11, 2008
    • Heikki Linnakangas's avatar
      Introduce the concept of relation forks. An smgr relation can now consist · 3f0e808c
      Heikki Linnakangas authored
      of multiple forks, and each fork can be created and grown separately.
      
      The bulk of this patch is about changing the smgr API to include an extra
      ForkNumber argument in every smgr function. Also, smgrscheduleunlink and
      smgrdounlink no longer implicitly call smgrclose, because other forks might
      still exist after unlinking one. The callers of those functions have been
      modified to call smgrclose instead.
      
      This patch in itself doesn't have any user-visible effect, but provides the
      infrastructure needed for upcoming patches. The additional forks envisioned
      are a rewritten FSM implementation that doesn't rely on a fixed-size shared
      memory block, and a visibility map to allow skipping portions of a table in
      VACUUM that have no dead tuples.
      3f0e808c
  20. Jan 01, 2008
  21. Nov 15, 2007
  22. Sep 24, 2007
    • Tom Lane's avatar
      Simplify and rename some GUC variables, per various recent discussions: · 48f7e643
      Tom Lane authored
      * stats_start_collector goes away; we always start the collector process,
      unless prevented by a problem with setting up the stats UDP socket.
      
      * stats_reset_on_server_start goes away; it seems useless in view of the
      availability of pg_stat_reset().
      
      * stats_block_level and stats_row_level are merged into a single variable
      "track_counts", which controls all reports sent to the collector process.
      
      * stats_command_string is renamed to track_activities.
      
      * log_autovacuum is renamed to log_autovacuum_min_duration to better reflect
      its meaning.
      
      The log_autovacuum change is not a compatibility issue since it didn't exist
      before 8.3 anyway.  The other changes need to be release-noted.
      48f7e643
  23. Aug 19, 2007
  24. Jul 25, 2007
  25. Jul 24, 2007
    • Tom Lane's avatar
      Create a new dedicated Postgres process, "wal writer", which exists to write · ad429572
      Tom Lane authored
      and fsync WAL at convenient intervals.  For the moment it just tries to
      offload this work from backends, but soon it will be responsible for
      guaranteeing a maximum delay before asynchronously-committed transactions
      will be flushed to disk.
      
      This is a portion of Simon Riggs' async-commit patch, committed to CVS
      separately because a background WAL writer seems like it might be a good idea
      independently of the async-commit feature.  I rebased walwriter.c on
      bgwriter.c because it seemed like a more appropriate way of handling signals;
      while the startup/shutdown logic in postmaster.c is more like autovac because
      we want walwriter to quit before we start the shutdown checkpoint.
      ad429572
  26. Jun 28, 2007
    • Tom Lane's avatar
      Implement "distributed" checkpoints in which the checkpoint I/O is spread · 867e2c91
      Tom Lane authored
      over a fairly long period of time, rather than being spat out in a burst.
      This happens only for background checkpoints carried out by the bgwriter;
      other cases, such as a shutdown checkpoint, are still done at full speed.
      
      Remove the "all buffers" scan in the bgwriter, and associated stats
      infrastructure, since this seems no longer very useful when the checkpoint
      itself is properly throttled.
      
      Original patch by Itagaki Takahiro, reworked by Heikki Linnakangas,
      and some minor API editorialization by me.
      867e2c91
  27. Jun 25, 2007
  28. Jun 14, 2007
  29. Apr 18, 2007
  30. Apr 16, 2007
    • Alvaro Herrera's avatar
      Add a multi-worker capability to autovacuum. This allows multiple worker · e2a186b0
      Alvaro Herrera authored
      processes to be running simultaneously.  Also, now autovacuum processes do not
      count towards the max_connections limit; they are counted separately from
      regular processes, and are limited by the new GUC variable
      autovacuum_max_workers.
      
      The launcher now has intelligence to launch workers on each database every
      autovacuum_naptime seconds, limited only on the max amount of worker slots
      available.
      
      Also, the global worker I/O utilization is limited by the vacuum cost-based
      delay feature.  Workers are "balanced" so that the total I/O consumption does
      not exceed the established limit.  This part of the patch was contributed by
      ITAGAKI Takahiro.
      
      Per discussion.
      e2a186b0
  31. Feb 16, 2007
    • Tom Lane's avatar
      Code review for SSLKEY patch. · b6c9165e
      Tom Lane authored
      b6c9165e
    • Bruce Momjian's avatar
      SSL improvements: · c7b08050
      Bruce Momjian authored
      	o read global SSL configuration file
      	o add GUC "ssl_ciphers" to control allowed ciphers
      	o add libpq environment variable PGSSLKEY to control SSL hardware keys
      
      Victor B. Wagner
      c7b08050
    • Alvaro Herrera's avatar
      Restructure autovacuum in two processes: a dummy process, which runs · 18206509
      Alvaro Herrera authored
      continuously, and requests vacuum runs of "autovacuum workers" to postmaster.
      The workers do the actual vacuum work.  This allows for future improvements,
      like allowing multiple autovacuum jobs running in parallel.
      
      For now, the code keeps the original behavior of having a single autovac
      process at any time by sleeping until the previous worker has finished.
      18206509
  32. Jan 16, 2007
  33. Jan 05, 2007
  34. Nov 05, 2006
    • Tom Lane's avatar
      Fix recently-understood problems with handling of XID freezing, particularly · 48188e16
      Tom Lane authored
      in PITR scenarios.  We now WAL-log the replacement of old XIDs with
      FrozenTransactionId, so that such replacement is guaranteed to propagate to
      PITR slave databases.  Also, rather than relying on hint-bit updates to be
      preserved, pg_clog is not truncated until all instances of an XID are known to
      have been replaced by FrozenTransactionId.  Add new GUC variables and
      pg_autovacuum columns to allow management of the freezing policy, so that
      users can trade off the size of pg_clog against the amount of freezing work
      done.  Revise the already-existing code that forces autovacuum of tables
      approaching the wraparound point to make it more bulletproof; also, revise the
      autovacuum logic so that anti-wraparound vacuuming is done per-table rather
      than per-database.  initdb forced because of changes in pg_class, pg_database,
      and pg_autovacuum catalogs.  Heikki Linnakangas, Simon Riggs, and Tom Lane.
      48188e16
  35. Oct 19, 2006
  36. Aug 08, 2006
    • Tom Lane's avatar
      Add a feature for automatic initialization and finalization of dynamically · b09bfcaa
      Tom Lane authored
      loaded libraries: call functions _PG_init() and _PG_fini() if the library
      defines such symbols.  Hence we no longer need to specify an initialization
      function in preload_libraries: we can assume that the library used the
      _PG_init() convention, instead.  This removes one source of pilot error
      in use of preloaded libraries.  Original patch by Ralf Engelschall,
      preload_libraries changes by me.
      b09bfcaa
  37. Mar 05, 2006
Loading