1. 07 2月, 2016 1 次提交
    • R
      Introduce group locking to prevent parallel processes from deadlocking. · a1c1af2a
      Robert Haas 提交于
      For locking purposes, we now regard heavyweight locks as mutually
      non-conflicting between cooperating parallel processes.  There are some
      possible pitfalls to this approach that are not to be taken lightly,
      but it works OK for now and can be changed later if we find a better
      approach.  Without this, it's very easy for parallel queries to
      silently self-deadlock if the user backend holds strong relation locks.
      
      Robert Haas, with help from Amit Kapila.  Thanks to Noah Misch and
      Andres Freund for extensive discussion of possible issues with this
      approach.
      a1c1af2a
  2. 03 1月, 2016 1 次提交
  3. 28 9月, 2015 1 次提交
  4. 07 1月, 2015 1 次提交
  5. 07 5月, 2014 1 次提交
    • B
      pgindent run for 9.4 · 0a783200
      Bruce Momjian 提交于
      This includes removing tabs after periods in C comments, which was
      applied to back branches, so this change should not effect backpatching.
      0a783200
  6. 08 1月, 2014 1 次提交
  7. 02 1月, 2013 1 次提交
  8. 27 7月, 2012 1 次提交
    • T
      Only allow autovacuum to be auto-canceled by a directly blocked process. · 26b43869
      Tom Lane 提交于
      In the original coding of the autovacuum cancel feature, commit
      acac68b2, an autovacuum process was
      considered a target for cancellation if it was found to hard-block any
      process examined in the deadlock search.  This patch tightens the test so
      that the autovacuum must directly hard-block the current process.  This
      should make the behavior more predictable in general, and in particular
      it ensures that an autovacuum will not be canceled with less than
      deadlock_timeout grace period.  In the old coding, it was possible for an
      autovacuum to be canceled almost instantly, given unfortunate timing of two
      or more other processes' lock attempts.
      
      This also justifies the logging methodology in the recent commit
      d7318d43; without this restriction, that
      patch isn't providing enough information to see the connection of the
      canceling process to the autovacuum.  Like that one, patch all the way
      back.
      26b43869
  9. 26 1月, 2012 1 次提交
  10. 02 1月, 2012 1 次提交
  11. 25 11月, 2011 1 次提交
    • R
      Move "hot" members of PGPROC into a separate PGXACT array. · ed0b409d
      Robert Haas 提交于
      This speeds up snapshot-taking and reduces ProcArrayLock contention.
      Also, the PGPROC (and PGXACT) structures used by two-phase commit are
      now allocated as part of the main array, rather than in a separate
      array, and we keep ProcArray sorted in pointer order.  These changes
      are intended to minimize the number of cache lines that must be pulled
      in to take a snapshot, and testing shows a substantial increase in
      performance on both read and write workloads at high concurrencies.
      
      Pavan Deolasee, Heikki Linnakangas, Robert Haas
      ed0b409d
  12. 17 7月, 2011 1 次提交
  13. 29 6月, 2011 1 次提交
  14. 02 1月, 2011 1 次提交
  15. 21 9月, 2010 1 次提交
  16. 03 1月, 2010 1 次提交
  17. 11 6月, 2009 1 次提交
  18. 02 1月, 2009 1 次提交
  19. 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
  20. 01 8月, 2008 1 次提交
  21. 25 3月, 2008 1 次提交
    • T
      Adjust the recent patch for reporting of deadlocked queries so that we report · 9b8e1eb3
      Tom Lane 提交于
      query texts only to the server log.  This eliminates the issue of possible
      leaking of security-sensitive data in other sessions' queries.  Since the
      log is presumed secure, we can now log the queries of all sessions involved
      in the deadlock, whether or not they belong to the same user as the one
      reporting the failure.
      9b8e1eb3
  22. 22 3月, 2008 1 次提交
    • T
      Report the current queries of all backends involved in a deadlock · 4b7ae4af
      Tom Lane 提交于
      (if they'd be visible to the current user in pg_stat_activity).
      
      This might look like it's subject to race conditions, but it's actually
      pretty safe because at the time DeadLockReport() is constructing the
      report, we haven't yet aborted our transaction and so we can expect that
      everyone else involved in the deadlock is still blocked on some lock.
      (There are corner cases where that might not be true, such as a statement
      timeout triggering in another backend before we finish reporting; but at
      worst we'd report a misleading activity string, so it seems acceptable
      considering the usefulness of reporting the queries.)
      
      Original patch by Itagaki Takahiro, heavily modified by me.
      4b7ae4af
  23. 02 1月, 2008 1 次提交
  24. 16 11月, 2007 1 次提交
  25. 27 10月, 2007 1 次提交
  26. 20 6月, 2007 1 次提交
    • 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
  27. 21 4月, 2007 1 次提交
  28. 04 3月, 2007 2 次提交
  29. 06 1月, 2007 1 次提交
  30. 23 9月, 2006 1 次提交
  31. 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
  32. 24 7月, 2006 1 次提交
  33. 14 7月, 2006 1 次提交
  34. 05 3月, 2006 1 次提交
  35. 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
  36. 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
  37. 29 10月, 2005 1 次提交
  38. 15 10月, 2005 1 次提交
  39. 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