1. 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
  2. 23 11月, 2005 1 次提交
  3. 18 11月, 2005 1 次提交
    • T
      DropRelFileNodeBuffers failed to fix the state of the lookup hash table · c859308a
      Tom Lane 提交于
      that was added to localbuf.c in 8.1; therefore, applying it to a temp table
      left corrupt lookup state in memory.  The only case where this had a
      significant chance of causing problems was an ON COMMIT DELETE ROWS temp
      table; the other possible paths left bogus state that was unlikely to
      be used again.  Per report from Csaba Nagy.
      c859308a
  4. 15 10月, 2005 1 次提交
  5. 13 10月, 2005 2 次提交
  6. 12 10月, 2005 2 次提交
  7. 23 9月, 2005 1 次提交
  8. 20 9月, 2005 1 次提交
  9. 29 8月, 2005 2 次提交
  10. 28 8月, 2005 1 次提交
  11. 27 8月, 2005 1 次提交
  12. 26 8月, 2005 2 次提交
  13. 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
  14. 20 8月, 2005 1 次提交
  15. 12 8月, 2005 2 次提交
  16. 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
  17. 02 8月, 2005 1 次提交
  18. 01 8月, 2005 1 次提交
  19. 27 7月, 2005 1 次提交
  20. 29 6月, 2005 1 次提交
    • T
      Bring syntax of role-related commands into SQL compliance. To avoid · 0eaa36a1
      Tom Lane 提交于
      syntactic conflicts, both privilege and role GRANT/REVOKE commands have
      to use the same production for scanning the list of tokens that might
      eventually turn out to be privileges or role names.  So, change the
      existing GRANT/REVOKE code to expect a list of strings not pre-reduced
      AclMode values.  Fix a couple other minor issues while at it, such as
      InitializeAcl function name conflicting with a Windows system function.
      0eaa36a1
  21. 20 6月, 2005 1 次提交
    • T
      Simplify uses of readdir() by creating a function ReadDir() that · 3f749924
      Tom Lane 提交于
      includes error checking and an appropriate ereport(ERROR) message.
      This gets rid of rather tedious and error-prone manipulation of errno,
      as well as a Windows-specific bug workaround, at more than a dozen
      call sites.  After an idea in a recent patch by Heikki Linnakangas.
      3f749924
  22. 18 6月, 2005 1 次提交
  23. 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
  24. 13 6月, 2005 1 次提交
    • T
      Adjust lo_open() so that specifying INV_READ without INV_WRITE creates · a2fb7b8a
      Tom Lane 提交于
      a descriptor that uses the current transaction snapshot, rather than
      SnapshotNow as it did before (and still does if INV_WRITE is set).
      This means pg_dump will now dump a consistent snapshot of large object
      contents, as it never could do before.  Also, add a lo_create() function
      that is similar to lo_creat() but allows the desired OID of the large
      object to be specified.  This will simplify pg_restore considerably
      (but I'll fix that in a separate commit).
      a2fb7b8a
  25. 07 6月, 2005 1 次提交
  26. 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
  27. 26 5月, 2005 1 次提交
  28. 20 5月, 2005 3 次提交
  29. 01 5月, 2005 1 次提交
  30. 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
  31. 29 4月, 2005 1 次提交
    • T
      Implement sharable row-level locks, and use them for foreign key references · bedb78d3
      Tom Lane 提交于
      to eliminate unnecessary deadlocks.  This commit adds SELECT ... FOR SHARE
      paralleling SELECT ... FOR UPDATE.  The implementation uses a new SLRU
      data structure (managed much like pg_subtrans) to represent multiple-
      transaction-ID sets.  When more than one transaction is holding a shared
      lock on a particular row, we create a MultiXactId representing that set
      of transactions and store its ID in the row's XMAX.  This scheme allows
      an effectively unlimited number of row locks, just as we did before,
      while not costing any extra overhead except when a shared lock actually
      has to be shared.   Still TODO: use the regular lock manager to control
      the grant order when multiple backends are waiting for a row lock.
      
      Alvaro Herrera and Tom Lane.
      bedb78d3
  32. 22 3月, 2005 1 次提交
    • T
      Create a routine PageIndexMultiDelete() that replaces a loop around · 94e03330
      Tom Lane 提交于
      PageIndexTupleDelete() with a single pass of compactification ---
      logic mostly lifted from PageRepairFragmentation.  I noticed while
      profiling that a VACUUM that's cleaning up a whole lot of deleted
      tuples would spend as much as a third of its CPU time in
      PageIndexTupleDelete; not too surprising considering the loop method
      was roughly O(N^2) in the number of tuples involved.
      94e03330
  33. 21 3月, 2005 1 次提交
    • T
      Remove unnecessary calls of FlushRelationBuffers: there is no need · 354049c7
      Tom Lane 提交于
      to write out data that we are about to tell the filesystem to drop.
      smgr_internal_unlink already had a DropRelFileNodeBuffers call to
      get rid of dead buffers without a write after it's no longer possible
      to roll back the deleting transaction.  Adding a similar call in
      smgrtruncate simplifies callers and makes the overall division of
      labor clearer.  This patch removes the former behavior that VACUUM
      would write all dirty buffers of a relation unconditionally.
      354049c7