1. 17 4月, 2007 1 次提交
    • A
      Add a multi-worker capability to autovacuum. This allows multiple worker · e2a186b0
      Alvaro Herrera 提交于
      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
  2. 04 4月, 2007 1 次提交
    • T
      Remove the CheckpointStartLock in favor of having backends show whether they · 9c9b6194
      Tom Lane 提交于
      are in their commit critical sections via flags in the ProcArray.  Checkpoint
      can watch the ProcArray to determine when it's safe to proceed.  This is
      a considerably better solution to the original problem of race conditions
      between checkpoint and transaction commit: it speeds up commit, since there's
      one less lock to fool with, and it prevents the problem of checkpoint being
      delayed indefinitely when there's a constant flow of commits.  Heikki, with
      some kibitzing from Tom.
      9c9b6194
  3. 07 3月, 2007 1 次提交
  4. 04 3月, 2007 1 次提交
  5. 16 2月, 2007 1 次提交
    • A
      Restructure autovacuum in two processes: a dummy process, which runs · 18206509
      Alvaro Herrera 提交于
      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
  6. 16 1月, 2007 1 次提交
  7. 06 1月, 2007 1 次提交
  8. 22 11月, 2006 1 次提交
    • T
      On systems that have setsid(2) (which should be just about everything except · 3ad0728c
      Tom Lane 提交于
      Windows), arrange for each postmaster child process to be its own process
      group leader, and deliver signals SIGINT, SIGTERM, SIGQUIT to the whole
      process group not only the direct child process.  This provides saner behavior
      for archive and recovery scripts; in particular, it's possible to shut down a
      warm-standby recovery server using "pg_ctl stop -m immediate", since delivery
      of SIGQUIT to the startup subprocess will result in killing the waiting
      recovery_command.  Also, this makes Query Cancel and statement_timeout apply
      to scripts being run from backends via system().  (There is no support in the
      core backend for that, but it's widely done using untrusted PLs.)  Per gripe
      from Stephen Harris and subsequent discussion.
      3ad0728c
  9. 04 10月, 2006 1 次提交
  10. 30 7月, 2006 1 次提交
  11. 24 7月, 2006 1 次提交
  12. 14 7月, 2006 2 次提交
  13. 21 6月, 2006 1 次提交
    • T
      Remove redundant gettimeofday() calls to the extent practical without · 27c3e3de
      Tom Lane 提交于
      changing semantics too much.  statement_timestamp is now set immediately
      upon receipt of a client command message, and the various places that used
      to do their own gettimeofday() calls to mark command startup are referenced
      to that instead.  I have also made stats_command_string use that same
      value for pg_stat_activity.query_start for both the command itself and
      its eventual replacement by <IDLE> or <idle in transaction>.  There was
      some debate about that, but no argument that seemed convincing enough to
      justify an extra gettimeofday() call.
      27c3e3de
  14. 14 4月, 2006 1 次提交
    • T
      Repair a low-probability race condition identified by Qingqing Zhou. · 0fcc3c2f
      Tom Lane 提交于
      If a process abandons a wait in LockBufferForCleanup (in practice,
      only happens if someone cancels a VACUUM) just before someone else
      sends it a signal indicating the buffer is available, it was possible
      for the wakeup to remain in the process' semaphore, causing misbehavior
      next time the process waited for an lmgr lock.  Rather than try to
      prevent the race condition directly, it seems best to make the lock
      manager robust against leftover wakeups, by having it repeat waiting
      on the semaphore if the lock has not actually been granted or denied
      yet.
      0fcc3c2f
  15. 05 3月, 2006 1 次提交
  16. 05 1月, 2006 2 次提交
  17. 12 12月, 2005 1 次提交
    • T
      Divide the lock manager's shared state into 'partitions', so as to · ec0baf94
      Tom Lane 提交于
      reduce contention for the former single LockMgrLock.  Per my recent
      proposal.  I set it up for 16 partitions, but on a pgbench test this
      gives only a marginal further improvement over 4 partitions --- we need
      to test more scenarios to choose the number of partitions.
      ec0baf94
  18. 09 12月, 2005 1 次提交
    • T
      Simplify lock manager data structures by making a clear separation between · c599a247
      Tom Lane 提交于
      the data defining the semantics of a lock method (ie, conflict resolution
      table and ancillary data, which is all constant) and the hash tables
      storing the current state.  The only thing we give up by this is the
      ability to use separate hashtables for different lock methods, but there
      is no need for that anyway.  Put some extra fields into the LockMethod
      definition structs to clean up some other uglinesses, like hard-wired
      tests for DEFAULT_LOCKMETHOD and USER_LOCKMETHOD.  This commit doesn't
      do anything about the performance issues we were discussing, but it clears
      away some of the underbrush that's in the way of fixing that.
      c599a247
  19. 23 11月, 2005 1 次提交
  20. 15 10月, 2005 1 次提交
  21. 13 10月, 2005 1 次提交
  22. 12 10月, 2005 1 次提交
  23. 20 9月, 2005 1 次提交
  24. 21 8月, 2005 1 次提交
    • T
      Convert the arithmetic for shared memory size calculation from 'int' · 0007490e
      Tom Lane 提交于
      to 'Size' (that is, size_t), and install overflow detection checks in it.
      This allows us to remove the former arbitrary restrictions on NBuffers
      etc.  It won't make any difference in a 32-bit machine, but in a 64-bit
      machine you could theoretically have terabytes of shared buffers.
      (How efficiently we could manage 'em remains to be seen.)  Similarly,
      num_temp_buffers, work_mem, and maintenance_work_mem can be set above
      2Gb on a 64-bit machine.  Original patch from Koichi Suzuki, additional
      work by moi.
      0007490e
  25. 08 8月, 2005 1 次提交
    • T
      Cause ShutdownPostgres to do a normal transaction abort during backend · 7117cd3a
      Tom Lane 提交于
      exit, instead of trying to take shortcuts.  Introduce some additional
      shutdown callback routines to eliminate kluges like having ProcKill
      be responsible for shutting down the buffer manager.  Ensure that the
      order of operations during shutdown is predictable and what you would
      expect given the module layering.
      7117cd3a
  26. 01 8月, 2005 1 次提交
  27. 18 6月, 2005 1 次提交
  28. 15 6月, 2005 1 次提交
    • T
      Simplify shared-memory lock data structures as per recent discussion: · 8563ccae
      Tom Lane 提交于
      it is sufficient to track whether a backend holds a lock or not, and
      store information about transaction vs. session locks only in the
      inside-the-backend LocalLockTable.  Since there can now be but one
      PROCLOCK per lock per backend, LockCountMyLocks() is no longer needed,
      thus eliminating some O(N^2) behavior when a backend holds many locks.
      Also simplify the LockAcquire/LockRelease API by passing just a
      'sessionLock' boolean instead of a transaction ID.  The previous API
      was designed with the idea that per-transaction lock holding would be
      important for subtransactions, but now that we have subtransactions we
      know that this is unwanted.  While at it, add an 'isTempObject' parameter
      to LockAcquire to indicate whether the lock is being taken on a temp
      table.  This is not used just yet, but will be needed shortly for
      two-phase commit.
      8563ccae
  29. 20 5月, 2005 1 次提交
  30. 15 4月, 2005 1 次提交
  31. 01 1月, 2005 1 次提交
    • P
      · 2ff50159
      PostgreSQL Daemon 提交于
      Tag appropriate files for rc3
      
      Also performed an initial run through of upgrading our Copyright date to
      extend to 2005 ... first run here was very simple ... change everything
      where: grep 1996-2004 && the word 'Copyright' ... scanned through the
      generated list with 'less' first, and after, to make sure that I only
      picked up the right entries ...
      2ff50159
  32. 17 10月, 2004 1 次提交
    • T
      Give the ResourceOwner mechanism full responsibility for releasing buffer · fdd13f15
      Tom Lane 提交于
      pins at end of transaction, and reduce AtEOXact_Buffers to an Assert
      cross-check that this was done correctly.  When not USE_ASSERT_CHECKING,
      AtEOXact_Buffers is a complete no-op.  This gets rid of an O(NBuffers)
      bottleneck during transaction commit/abort, which recent testing has shown
      becomes significant above a few tens of thousands of shared buffers.
      fdd13f15
  33. 29 9月, 2004 1 次提交
  34. 29 8月, 2004 2 次提交
  35. 28 8月, 2004 1 次提交
    • T
      Introduce local hash table for lock state, as per recent proposal. · 1785aceb
      Tom Lane 提交于
      PROCLOCK structs in shared memory now have only a bitmask for held
      locks, rather than counts (making them 40 bytes smaller, which is a
      good thing).  Multiple locks within a transaction are counted in the
      local hash table instead, and we have provision for tracking which
      ResourceOwner each count belongs to.  Solves recently reported problem
      with memory leakage within long transactions.
      1785aceb
  36. 17 7月, 2004 1 次提交
    • T
      Invent ResourceOwner mechanism as per my recent proposal, and use it to · fe548629
      Tom Lane 提交于
      keep track of portal-related resources separately from transaction-related
      resources.  This allows cursors to work in a somewhat sane fashion with
      nested transactions.  For now, cursor behavior is non-subtransactional,
      that is a cursor's state does not roll back if you abort a subtransaction
      that fetched from the cursor.  We might want to change that later.
      fe548629
  37. 01 7月, 2004 1 次提交