1. 27 10月, 2007 1 次提交
  2. 25 10月, 2007 1 次提交
  3. 09 9月, 2007 1 次提交
    • T
      Replace the former method of determining snapshot xmax --- to wit, calling · 6bd4f401
      Tom Lane 提交于
      ReadNewTransactionId from GetSnapshotData --- with a "latestCompletedXid"
      variable that is updated during transaction commit or abort.  Since
      latestCompletedXid is written only in places that had to lock ProcArrayLock
      exclusively anyway, and is read only in places that had to lock ProcArrayLock
      shared anyway, it adds no new locking requirements to the system despite being
      cluster-wide.  Moreover, removing ReadNewTransactionId from snapshot
      acquisition eliminates the need to take both XidGenLock and ProcArrayLock at
      the same time.  Since XidGenLock is sometimes held across I/O this can be a
      significant win.  Some preliminary benchmarking suggested that this patch has
      no effect on average throughput but can significantly improve the worst-case
      transaction times seen in pgbench.  Concept by Florian Pflug, implementation
      by Tom Lane.
      6bd4f401
  4. 06 9月, 2007 1 次提交
    • T
      Implement lazy XID allocation: transactions that do not modify any database · 295e6398
      Tom Lane 提交于
      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
  5. 28 8月, 2007 1 次提交
    • T
      Improve behavior of log_lock_waits patch. Ensure that something gets logged · 24d4517b
      Tom Lane 提交于
      even if the "deadlock detected" ERROR message is suppressed by an exception
      catcher.  Be clearer about the event sequence when a soft deadlock is fixed:
      the fixing process might or might not still have to wait, so log that
      separately.  Fix race condition when someone releases us from the lock partway
      through printing all this junk --- we'd not get confused about our state, but
      the log message sequence could have been misleading, ie, a "still waiting"
      message with no subsequent "acquired" message.  Greg Stark and Tom Lane.
      24d4517b
  6. 17 7月, 2007 1 次提交
  7. 20 6月, 2007 2 次提交
    • T
      Only log 'process acquired lock' if we actually did get the lock. This · 9cce91db
      Tom Lane 提交于
      test seems inessential right now since the only control path for not
      getting the lock is via CHECK_FOR_INTERRUPTS which won't return control
      to ProcSleep, but it would be important if we ever allow the deadlock
      code to kill someone else's transaction instead of our own.
      9cce91db
    • T
      Code review for log_lock_waits patch. Don't try to issue log messages from · 6e072287
      Tom Lane 提交于
      within a signal handler (this might be safe given the relatively narrow code
      range in which the interrupt is enabled, but it seems awfully risky); do issue
      more informative log messages that tell what is being waited for and the exact
      length of the wait; minor other code cleanup.  Greg Stark and Tom Lane
      6e072287
  8. 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
  9. 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
  10. 07 3月, 2007 1 次提交
  11. 04 3月, 2007 1 次提交
  12. 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
  13. 16 1月, 2007 1 次提交
  14. 06 1月, 2007 1 次提交
  15. 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
  16. 04 10月, 2006 1 次提交
  17. 30 7月, 2006 1 次提交
  18. 24 7月, 2006 1 次提交
  19. 14 7月, 2006 2 次提交
  20. 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
  21. 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
  22. 05 3月, 2006 1 次提交
  23. 05 1月, 2006 2 次提交
  24. 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
  25. 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
  26. 23 11月, 2005 1 次提交
  27. 15 10月, 2005 1 次提交
  28. 13 10月, 2005 1 次提交
  29. 12 10月, 2005 1 次提交
  30. 20 9月, 2005 1 次提交
  31. 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
  32. 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
  33. 01 8月, 2005 1 次提交
  34. 18 6月, 2005 1 次提交
  35. 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
  36. 20 5月, 2005 1 次提交
  37. 15 4月, 2005 1 次提交