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. 15 10月, 2005 1 次提交
  3. 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
  4. 18 6月, 2005 1 次提交
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 29 8月, 2004 2 次提交
  11. 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
  12. 27 8月, 2004 1 次提交
  13. 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
  14. 01 7月, 2004 1 次提交
  15. 28 5月, 2004 1 次提交
    • T
      Code review for EXEC_BACKEND changes. Reduce the number of #ifdefs by · 1a321f26
      Tom Lane 提交于
      about a third, make it work on non-Windows platforms again.  (But perhaps
      I broke the WIN32 code, since I have no way to test that.)  Fold all the
      paths that fork postmaster child processes to go through the single
      routine SubPostmasterMain, which takes care of resurrecting the state that
      would normally be inherited from the postmaster (including GUC variables).
      Clean up some places where there's no particularly good reason for the
      EXEC and non-EXEC cases to work differently.  Take care of one or two
      FIXMEs that remained in the code.
      1a321f26
  16. 21 12月, 2003 1 次提交
  17. 02 12月, 2003 1 次提交
    • B
      Try to reduce confusion about what is a lock method identifier, a lock · e7ca8674
      Bruce Momjian 提交于
      method control structure, or a table of control structures.
      
      . Use type LOCKMASK where an int is not a counter.
      
      . Get rid of INVALID_TABLEID, use INVALID_LOCKMETHOD instead.
      
      . Use INVALID_LOCKMETHOD instead of (LOCKMETHOD) NULL, because
        LOCKMETHOD is not a pointer.
      
      . Define and use macro LockMethodIsValid.
      
      . Rename LOCKMETHOD to LOCKMETHODID.
      
      . Remove global variable LongTermTableId in lmgr.c, because it is
        never used.
      
      . Make LockTableId static in lmgr.c, because it is used nowhere else.
        Why not remove it and use DEFAULT_LOCKMETHOD?
      
      . Rename the lock method control structure from LOCKMETHODTABLE to
        LockMethodData.  Introduce a pointer type named LockMethod.
      
      . Remove elog(FATAL) after InitLockTable() call in
        CreateSharedMemoryAndSemaphores(), because if something goes wrong,
        there is elog(FATAL) in LockMethodTableInit(), and if this doesn't
        help, an elog(ERROR) in InitLockTable() is promoted to FATAL.
      
      . Make InitLockTable() void, because its only caller does not use its
        return value any more.
      
      . Rename variables in lock.c to avoid statements like
              LockMethodTable[NumLockMethods] = lockMethodTable;
              lockMethodTable = LockMethodTable[lockmethod];
      
      . Change LOCKMETHODID type to uint16 to fit into struct LOCKTAG.
      
      . Remove static variables BITS_OFF and BITS_ON from lock.c, because
        I agree to this doubt:
       * XXX is a fetch from a static array really faster than a shift?
      
      . Define and use macros LOCKBIT_ON/OFF.
      
      
      Manfred Koizar
      e7ca8674
  18. 30 11月, 2003 1 次提交
    • P
      · 55b11325
      PostgreSQL Daemon 提交于
      make sure the $Id tags are converted to $PostgreSQL as well ...
      55b11325
  19. 04 8月, 2003 2 次提交
  20. 20 2月, 2003 1 次提交
  21. 19 2月, 2003 1 次提交
    • B
      - Modifies LOCKTAG to include a 'classId'. Relation receive a classId of · d0f3a7e9
      Bruce Momjian 提交于
      RelOid_pg_class, and transaction locks XactLockTableId. RelId is renamed
      to objId.
      
      - LockObject() and UnlockObject() functions created, and their use
      sprinkled throughout the code to do descent locking for domains and
      types. They accept lock modes AccessShare and AccessExclusive, as we
      only really need a 'read' and 'write' lock at the moment.  Most locking
      cases are held until the end of the transaction.
      
      This fixes the cases Tom mentioned earlier in regards to locking with
      Domains.  If the patch is good, I'll work on cleaning up issues with
      other database objects that have this problem (most of them).
      
      Rod Taylor
      d0f3a7e9
  22. 18 2月, 2003 1 次提交
  23. 17 1月, 2003 1 次提交
  24. 05 9月, 2002 1 次提交
  25. 01 9月, 2002 1 次提交
    • T
      Code review for pg_locks feature. Make shmemoffset of PROCLOCK structs · 1bab464e
      Tom Lane 提交于
      available (else there's no way to interpret the list links).  Change
      pg_locks view to show transaction ID locks separately from ordinary
      relation locks.  Avoid showing N duplicate rows when the same lock is
      held multiple times (seems unlikely that users care about exact hold
      count).  Improve documentation.
      1bab464e
  26. 17 8月, 2002 1 次提交
    • B
      [ Newest version of patch applied.] · 82119a69
      Bruce Momjian 提交于
      This patch is an updated version of the lock listing patch. I've made
      the following changes:
      
          - write documentation
          - wrap the SRF in a view called 'pg_locks': all user-level
            access should be done through this view
          - re-diff against latest CVS
      
      One thing I chose not to do is adapt the SRF to use the anonymous
      composite type code from Joe Conway. I'll probably do that eventually,
      but I'm not really convinced it's a significantly cleaner way to
      bootstrap SRF builtins than the method this patch uses (of course, it
      has other uses...)
      
      Neil Conway
      82119a69
  27. 01 8月, 2002 1 次提交
  28. 19 7月, 2002 2 次提交
  29. 21 6月, 2002 1 次提交
  30. 11 6月, 2002 1 次提交
    • J
      Katherine Ward wrote: · 469cb65a
      Jan Wieck 提交于
      > Changes to avoid collisions with WIN32 & MFC names...
      > 1.  Renamed:
      >       a.  PROC => PGPROC
      >       b.  GetUserName() => GetUserNameFromId()
      >       c.  GetCurrentTime() => GetCurrentDateTime()
      >       d.  IGNORE => IGNORE_DTF in include/utils/datetime.h & utils/adt/datetim
      >
      > 2.  Added _P to some lex/yacc tokens:
      >       CONST, CHAR, DELETE, FLOAT, GROUP, IN, OUT
      
      Jan
      469cb65a
  31. 06 11月, 2001 1 次提交
  32. 28 10月, 2001 1 次提交
  33. 25 10月, 2001 1 次提交
  34. 01 10月, 2001 1 次提交
    • T
      Another round of cleanups for dynahash.c (maybe it's finally clean of · 5999e78f
      Tom Lane 提交于
      portability issues).  Caller-visible data structures are now allocated
      on MAXALIGN boundaries, allowing safe use of datatypes wider than 'long'.
      Rejigger hash_create API so that caller specifies size of key and
      total size of entry, not size of key and size of rest of entry.
      This simplifies life considerably since each number is just a sizeof(),
      and padding issues etc. are taken care of automatically.
      5999e78f
  35. 30 9月, 2001 2 次提交
  36. 29 9月, 2001 1 次提交
    • T
      Implement new 'lightweight lock manager' that's intermediate between · 499abb0c
      Tom Lane 提交于
      existing lock manager and spinlocks: it understands exclusive vs shared
      lock but has few other fancy features.  Replace most uses of spinlocks
      with lightweight locks.  All remaining uses of spinlocks have very short
      lock hold times (a few dozen instructions), so tweak spinlock backoff
      code to work efficiently given this assumption.  All per my proposal on
      pghackers 26-Sep-01.
      499abb0c