1. 23 3月, 2009 1 次提交
  2. 02 1月, 2009 1 次提交
  3. 03 11月, 2008 1 次提交
    • T
      Remove the last vestiges of the MAKE_PTR/MAKE_OFFSET mechanism. We haven't · d7112cfa
      Tom Lane 提交于
      allowed different processes to have different addresses for the shmem segment
      in quite a long time, but there were still a few places left that used the
      old coding convention.  Clean them up to reduce confusion and improve the
      compiler's ability to detect pointer type mismatches.
      
      Kris Jurka
      d7112cfa
  4. 01 8月, 2008 1 次提交
  5. 18 3月, 2008 1 次提交
    • P
      Enable probes to work with Mac OS X Leopard and other OSes that will · a7b7b07a
      Peter Eisentraut 提交于
      support DTrace in the future.
      
      Switch from using DTRACE_PROBEn macros to the dynamically generated macros.
      Use "dtrace -h" to create a header file that contains the dynamically
      generated macros to be used in the source code instead of the DTRACE_PROBEn
      macros.  A dummy header file is generated for builds without DTrace support.
      
      Author: Robert Lor <Robert.Lor@sun.com>
      a7b7b07a
  6. 05 3月, 2008 1 次提交
    • T
      Fix PREPARE TRANSACTION to reject the case where the transaction has dropped a · 7d6e6e2e
      Tom Lane 提交于
      temporary table; we can't support that because there's no way to clean up the
      source backend's internal state if the eventual COMMIT PREPARED is done by
      another backend.  This was checked correctly in 8.1 but I broke it in 8.2 :-(.
      Patch by Heikki Linnakangas, original trouble report by John Smith.
      7d6e6e2e
  7. 03 2月, 2008 1 次提交
    • T
      Fix WaitOnLock() to ensure that the process's "waiting" flag is reset after · 6f906905
      Tom Lane 提交于
      erroring out of a wait.  We can use a PG_TRY block for this, but add a comment
      explaining why it'd be a bad idea to use it for any other state cleanup.
      
      Back-patch to 8.2.  Prior releases had the same issue, but only with respect
      to the process title, which is likely to get reset almost immediately anyway
      after the transaction aborts, so it seems not worth changing them.  In 8.2
      and HEAD, the pg_stat_activity "waiting" flag could remain set incorrectly
      for a long time.
      
      Per report from Gurjeet Singh.
      6f906905
  8. 02 1月, 2008 1 次提交
  9. 16 11月, 2007 1 次提交
  10. 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
  11. 17 7月, 2007 1 次提交
  12. 02 2月, 2007 1 次提交
    • B
      Wording cleanup for error messages. Also change can't -> cannot. · 8b4ff8b6
      Bruce Momjian 提交于
      Standard English uses "may", "can", and "might" in different ways:
      
              may - permission, "You may borrow my rake."
      
              can - ability, "I can lift that log."
      
              might - possibility, "It might rain today."
      
      Unfortunately, in conversational English, their use is often mixed, as
      in, "You may use this variable to do X", when in fact, "can" is a better
      choice.  Similarly, "It may crash" is better stated, "It might crash".
      8b4ff8b6
  13. 06 1月, 2007 1 次提交
  14. 04 10月, 2006 1 次提交
  15. 19 9月, 2006 1 次提交
    • T
      Add built-in userlock manipulation functions to replace the former · 9b4cda0d
      Tom Lane 提交于
      contrib functionality.  Along the way, remove the USER_LOCKS configuration
      symbol, since it no longer makes any sense to try to compile that out.
      No user documentation yet ... mmoncure has promised to write some.
      Thanks to Abhijit Menon-Sen for creating a first draft to work from.
      9b4cda0d
  16. 28 8月, 2006 1 次提交
    • T
      Add a function GetLockConflicts() to lock.c to report xacts holding · e06fda0a
      Tom Lane 提交于
      locks that would conflict with a specified lock request, without
      actually trying to get that lock.  Use this instead of the former ad hoc
      method of doing the first wait step in CREATE INDEX CONCURRENTLY.
      Fixes problem with undetected deadlock and in many cases will allow the
      index creation to proceed sooner than it otherwise could've.  Per
      discussion with Greg Stark.
      e06fda0a
  17. 19 8月, 2006 1 次提交
  18. 01 8月, 2006 1 次提交
    • T
      Change the relation_open protocol so that we obtain lock on a relation · 09d3670d
      Tom Lane 提交于
      (table or index) before trying to open its relcache entry.  This fixes
      race conditions in which someone else commits a change to the relation's
      catalog entries while we are in process of doing relcache load.  Problems
      of that ilk have been reported sporadically for years, but it was not
      really practical to fix until recently --- for instance, the recent
      addition of WAL-log support for in-place updates helped.
      
      Along the way, remove pg_am.amconcurrent: all AMs are now expected to support
      concurrent update.
      09d3670d
  19. 25 7月, 2006 1 次提交
  20. 24 7月, 2006 1 次提交
  21. 23 7月, 2006 1 次提交
  22. 14 7月, 2006 1 次提交
  23. 28 6月, 2006 1 次提交
  24. 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
  25. 05 3月, 2006 1 次提交
  26. 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
  27. 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
  28. 23 11月, 2005 1 次提交
  29. 05 11月, 2005 1 次提交
    • T
      Repair an error introduced by log_line_prefix patch: it is not acceptable · 48052de7
      Tom Lane 提交于
      to assume that the string pointer passed to set_ps_display is good forever.
      There's no need to anyway since ps_status.c itself saves the string, and
      we already had an API (get_ps_display) to return it.
      I believe this explains Jim Nasby's report of intermittent crashes in
      elog.c when %i format code is in use in log_line_prefix.
      While at it, repair a previously unnoticed problem: on some platforms such as
      Darwin, the string returned by get_ps_display was blank-padded to the maximum
      length, meaning that lock.c's attempt to append " waiting" to it never worked.
      48052de7
  30. 15 10月, 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. 18 6月, 2005 1 次提交
  33. 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
  34. 30 5月, 2005 1 次提交
    • T
      Improve LockAcquire API per my recent proposal. All error conditions · 140b078d
      Tom Lane 提交于
      are now reported via elog, eliminating the need to test the result code
      at most call sites.  Make it possible for the caller to distinguish a
      freshly acquired lock from one already held in the current transaction.
      Use that capability to avoid redundant AcceptInvalidationMessages() calls
      in LockRelation().
      140b078d
  35. 29 5月, 2005 1 次提交
    • T
      Modify hash_search() API to prevent future occurrences of the error · e92a8827
      Tom Lane 提交于
      spotted by Qingqing Zhou.  The HASH_ENTER action now automatically
      fails with elog(ERROR) on out-of-memory --- which incidentally lets
      us eliminate duplicate error checks in quite a bunch of places.  If
      you really need the old return-NULL-on-out-of-memory behavior, you
      can ask for HASH_ENTER_NULL.  But there is now an Assert in that path
      checking that you aren't hoping to get that behavior in a palloc-based
      hash table.
      Along the way, remove the old HASH_FIND_SAVE/HASH_REMOVE_SAVED actions,
      which were not being used anywhere anymore, and were surely too ugly
      and unsafe to want to see revived again.
      e92a8827
  36. 20 5月, 2005 1 次提交
    • T
      Factor out lock cleanup code that is needed in several places in lock.c. · 191b13aa
      Tom Lane 提交于
      Also, remove the rather useless return value of LockReleaseAll.  Change
      response to detection of corruption in the shared lock tables to PANIC,
      since that is the only way of cleaning up fully.
      Originally an idea of Heikki Linnakangas, variously hacked on by
      Alvaro Herrera and Tom Lane.
      191b13aa
  37. 11 5月, 2005 1 次提交
  38. 30 4月, 2005 1 次提交
    • T
      Restructure LOCKTAG as per discussions of a couple months ago. · 3a694bb0
      Tom Lane 提交于
      Essentially, we shoehorn in a lockable-object-type field by taking
      a byte away from the lockmethodid, which can surely fit in one byte
      instead of two.  This allows less artificial definitions of all the
      other fields of LOCKTAG; we can get rid of the special pg_xactlock
      pseudo-relation, and also support locks on individual tuples and
      general database objects (including shared objects).  None of those
      possibilities are actually exploited just yet, however.
      
      I removed pg_xactlock from pg_class, but did not force initdb for
      that change.  At this point, relkind 's' (SPECIAL) is unused and
      could be removed entirely.
      3a694bb0
  39. 14 4月, 2005 1 次提交
    • T
      Simplify initdb-time assignment of OIDs as I proposed yesterday, and · 2193a856
      Tom Lane 提交于
      avoid encroaching on the 'user' range of OIDs by allowing automatic
      OID assignment to use values below 16k until we reach normal operation.
      
      initdb not forced since this doesn't make any incompatible change;
      however a lot of stuff will have different OIDs after your next initdb.
      2193a856
  40. 11 3月, 2005 1 次提交