CVS log for pgsql/src/include/storage/lock.h

[BACK] Up to [PostgreSQL CVS Repository] / pgsql / src / include / storage

Request diff between arbitrary revisions - Display revisions graphically


Keyword substitution: kv
Default branch: MAIN


Revision 1.119: download - view: text, markup, annotated - select for diffs
Fri Feb 26 02:01:27 2010 UTC (2 years, 2 months ago) by momjian
Branches: MAIN
CVS tags: REL9_1_ALPHA1, REL9_0_STABLE, REL9_0_RC1, REL9_0_BETA4, REL9_0_BETA3, REL9_0_BETA2, REL9_0_BETA1, REL9_0_ALPHA5_BRANCH, REL9_0_ALPHA5, REL9_0_0, HEAD
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +9 -9 lines
pgindent run for 9.0

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sat Jan 2 16:58:08 2010 UTC (2 years, 4 months ago) by momjian
Branches: MAIN
CVS tags: REL9_0_ALPHA4_BRANCH, REL9_0_ALPHA4
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +2 -2 lines
Update copyright for the year 2010.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Sat Dec 19 01:32:44 2009 UTC (2 years, 4 months ago) by sriggs
Branches: MAIN
CVS tags: REL8_5_ALPHA3_BRANCH, REL8_5_ALPHA3
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +19 -1 lines
Allow read only connections during recovery, known as Hot Standby.

Enabled by recovery_connections = on (default) and forcing archive recovery using a recovery.conf. Recovery processing now emulates the original transactions as they are replayed, providing full locking and MVCC behaviour for read only queries. Recovery must enter consistent state before connections are allowed, so there is a delay, typically short, before connections succeed. Replay of recovering transactions can conflict and in some cases deadlock with queries during recovery; these result in query cancellation after max_standby_delay seconds have expired. Infrastructure changes have minor effects on normal running, though introduce four new types of WAL record.

New test mode "make standbycheck" allows regression tests of static command behaviour on a standby server while in recovery. Typical and extreme dynamic behaviours have been checked via code inspection and manual testing. Few port specific behaviours have been utilised, though primary testing has been on Linux only so far.

This commit is the basic patch. Additional changes will follow in this release to enhance some aspects of behaviour, notably improved handling of conflicts, deadlock detection and query cancellation. Changes to VACUUM FULL are also required.

Simon Riggs, with significant and lengthy review by Heikki Linnakangas, including streamlined redesign of snapshot creation and two-phase commit.

Important contributions from Florian Pflug, Mark Kirkwood, Merlin Moncure, Greg Stark, Gianni Ciolli, Gabriele Bartolini, Hannu Krosing, Robert Haas, Tatsuo Ishii, Hiroyuki Yamada plus support and feedback from many other community members.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Sat Apr 4 17:40:36 2009 UTC (3 years, 1 month ago) by tgl
Branches: MAIN
CVS tags: REL8_5_ALPHA2_BRANCH, REL8_5_ALPHA2, REL8_5_ALPHA1_BRANCH, REL8_5_ALPHA1, REL8_4_STABLE, REL8_4_RC2, REL8_4_RC1, REL8_4_BETA2, REL8_4_BETA1, REL8_4_4, REL8_4_3, REL8_4_2, REL8_4_1, REL8_4_0
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +7 -1 lines
A session that does not have any live snapshots does not have to be waited for
when we are waiting for old snapshots to go away during a concurrent index
build.  In particular, this rule lets us avoid waiting for
idle-in-transaction sessions.

This logic could be improved further if we had some way to wake up when
the session we are currently waiting for goes idle-in-transaction.  However
that would be a significantly more complex/invasive patch, so it'll have to
wait for some other day.

Simon Riggs, with some improvements by Tom.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Thu Jan 1 17:24:01 2009 UTC (3 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +2 -2 lines
Update copyright for 2009.

Revision 1.84.4.1: download - view: text, markup, annotated - select for diffs
Tue Sep 16 01:56:56 2008 UTC (3 years, 8 months ago) by tgl
Branches: REL8_0_STABLE
CVS tags: REL8_0_25, REL8_0_24, REL8_0_23, REL8_0_22, REL8_0_21, REL8_0_20, REL8_0_19, REL8_0_18
Diff to: previous 1.84: preferred, colored; next MAIN 1.85: preferred, colored
Changes since revision 1.84: +3 -3 lines
Widen the nLocks counts in local lock tables from int to int64.  This
forestalls potential overflow when the same table (or other object, but
usually tables) is accessed by very many successive queries within a single
transaction.  Per report from Michael Milligan.

Back-patch to 8.0, which is as far back as the patch conveniently applies.
There have been no reports of overflow in pre-8.3 releases, but clearly the
risk existed all along.  (Michael's report suggests that 8.3 may consume lock
counts faster than prior releases, but with no test case to look at it's hard
to be sure about that.  Widening the counts seems a good future-proofing
measure in any event.)

Revision 1.91.2.1: download - view: text, markup, annotated - select for diffs
Tue Sep 16 01:56:49 2008 UTC (3 years, 8 months ago) by tgl
Branches: REL8_1_STABLE
CVS tags: REL8_1_21, REL8_1_20, REL8_1_19, REL8_1_18, REL8_1_17, REL8_1_16, REL8_1_15, REL8_1_14
Diff to: previous 1.91: preferred, colored; next MAIN 1.92: preferred, colored
Changes since revision 1.91: +3 -3 lines
Widen the nLocks counts in local lock tables from int to int64.  This
forestalls potential overflow when the same table (or other object, but
usually tables) is accessed by very many successive queries within a single
transaction.  Per report from Michael Milligan.

Back-patch to 8.0, which is as far back as the patch conveniently applies.
There have been no reports of overflow in pre-8.3 releases, but clearly the
risk existed all along.  (Michael's report suggests that 8.3 may consume lock
counts faster than prior releases, but with no test case to look at it's hard
to be sure about that.  Widening the counts seems a good future-proofing
measure in any event.)

Revision 1.102.2.1: download - view: text, markup, annotated - select for diffs
Tue Sep 16 01:56:43 2008 UTC (3 years, 8 months ago) by tgl
Branches: REL8_2_STABLE
CVS tags: REL8_2_17, REL8_2_16, REL8_2_15, REL8_2_14, REL8_2_13, REL8_2_12, REL8_2_11, REL8_2_10
Diff to: previous 1.102: preferred, colored; next MAIN 1.103: preferred, colored
Changes since revision 1.102: +3 -3 lines
Widen the nLocks counts in local lock tables from int to int64.  This
forestalls potential overflow when the same table (or other object, but
usually tables) is accessed by very many successive queries within a single
transaction.  Per report from Michael Milligan.

Back-patch to 8.0, which is as far back as the patch conveniently applies.
There have been no reports of overflow in pre-8.3 releases, but clearly the
risk existed all along.  (Michael's report suggests that 8.3 may consume lock
counts faster than prior releases, but with no test case to look at it's hard
to be sure about that.  Widening the counts seems a good future-proofing
measure in any event.)

Revision 1.112.2.1: download - view: text, markup, annotated - select for diffs
Tue Sep 16 01:56:35 2008 UTC (3 years, 8 months ago) by tgl
Branches: REL8_3_STABLE
CVS tags: REL8_3_9, REL8_3_8, REL8_3_7, REL8_3_6, REL8_3_5, REL8_3_4, REL8_3_11, REL8_3_10
Diff to: previous 1.112: preferred, colored; next MAIN 1.113: preferred, colored
Changes since revision 1.112: +3 -3 lines
Widen the nLocks counts in local lock tables from int to int64.  This
forestalls potential overflow when the same table (or other object, but
usually tables) is accessed by very many successive queries within a single
transaction.  Per report from Michael Milligan.

Back-patch to 8.0, which is as far back as the patch conveniently applies.
There have been no reports of overflow in pre-8.3 releases, but clearly the
risk existed all along.  (Michael's report suggests that 8.3 may consume lock
counts faster than prior releases, but with no test case to look at it's hard
to be sure about that.  Widening the counts seems a good future-proofing
measure in any event.)

Revision 1.114: download - view: text, markup, annotated - select for diffs
Tue Sep 16 01:56:26 2008 UTC (3 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +3 -3 lines
Widen the nLocks counts in local lock tables from int to int64.  This
forestalls potential overflow when the same table (or other object, but
usually tables) is accessed by very many successive queries within a single
transaction.  Per report from Michael Milligan.

Back-patch to 8.0, which is as far back as the patch conveniently applies.
There have been no reports of overflow in pre-8.3 releases, but clearly the
risk existed all along.  (Michael's report suggests that 8.3 may consume lock
counts faster than prior releases, but with no test case to look at it's hard
to be sure about that.  Widening the counts seems a good future-proofing
measure in any event.)

Revision 1.113: download - view: text, markup, annotated - select for diffs
Mon May 12 00:00:54 2008 UTC (4 years ago) by alvherre
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +1 -3 lines
Restructure some header files a bit, in particular heapam.h, by removing some
unnecessary #include lines in it.  Also, move some tuple routine prototypes and
macros to htup.h, which allows removal of heapam.h inclusion from some .c
files.

For this to work, a new header file access/sysattr.h needed to be created,
initially containing attribute numbers of system columns, for pg_dump usage.

While at it, make contrib ltree, intarray and hstore header files more
consistent with our header style.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Tue Jan 8 23:18:51 2008 UTC (4 years, 4 months ago) by tgl
Branches: MAIN
CVS tags: REL8_3_RC2, REL8_3_3, REL8_3_2, REL8_3_1, REL8_3_0
Branch point for: REL8_3_STABLE
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +3 -1 lines
lmgr.c:DescribeLockTag was never taught about virtual xids, per Greg Stark.
Also a couple of minor tweaks to try to future-proof the code a bit better
against future locktag additions.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Tue Jan 1 19:45:59 2008 UTC (4 years, 4 months ago) by momjian
Branches: MAIN
CVS tags: REL8_3_RC1
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +2 -2 lines
Update copyrights in source tree to 2008.

Revision 1.110: download - view: text, markup, annotated - select for diffs
Thu Nov 15 22:25:17 2007 UTC (4 years, 6 months ago) by momjian
Branches: MAIN
CVS tags: REL8_3_BETA4, REL8_3_BETA3
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +3 -3 lines
Re-run pgindent with updated list of typedefs.  (Updated README should
avoid this problem in the future.)

Revision 1.109: download - view: text, markup, annotated - select for diffs
Thu Nov 15 21:14:44 2007 UTC (4 years, 6 months ago) by momjian
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +10 -9 lines
pgindent run for 8.3.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Fri Oct 26 20:45:10 2007 UTC (4 years, 6 months ago) by alvherre
Branches: MAIN
CVS tags: REL8_3_BETA2
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +5 -2 lines
Allow an autovacuum worker to be interrupted automatically when it is found
to be locking another process (except when it's working to prevent Xid
wraparound problems).

Revision 1.107: download - view: text, markup, annotated - select for diffs
Wed Sep 5 18:10:48 2007 UTC (4 years, 8 months ago) by tgl
Branches: MAIN
CVS tags: REL8_3_BETA1
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +45 -2 lines
Implement lazy XID allocation: transactions that do not modify any database
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.

Revision 1.106: download - view: text, markup, annotated - select for diffs
Tue Jun 19 20:13:22 2007 UTC (4 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +7 -5 lines
Code review for log_lock_waits patch.  Don't try to issue log messages from
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

Revision 1.105: download - view: text, markup, annotated - select for diffs
Wed May 30 16:16:32 2007 UTC (4 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +2 -2 lines
Fix trivial misspelling in comment.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Sat Mar 3 18:46:40 2007 UTC (5 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +9 -2 lines
Add GUC log_lock_waits to log long wait times.

Simon Riggs

Revision 1.103: download - view: text, markup, annotated - select for diffs
Fri Jan 5 22:19:58 2007 UTC (5 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +2 -2 lines
Update CVS HEAD for 2007 copyright.  Back branches are typically not
back-stamped for this.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Thu Nov 23 05:14:04 2006 UTC (5 years, 5 months ago) by momjian
Branches: MAIN
CVS tags: REL8_2_RC1, REL8_2_9, REL8_2_8, REL8_2_7, REL8_2_6, REL8_2_5, REL8_2_4, REL8_2_3, REL8_2_2, REL8_2_1, REL8_2_0
Branch point for: REL8_2_STABLE
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +4 -3 lines
Update lock comments for concurrent index creation, analyze.

Walter Cruz

Revision 1.101: download - view: text, markup, annotated - select for diffs
Wed Oct 4 00:30:10 2006 UTC (5 years, 7 months ago) by momjian
Branches: MAIN
CVS tags: REL8_2_BETA3, REL8_2_BETA2
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +2 -2 lines
pgindent run for 8.2.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Fri Sep 22 23:20:14 2006 UTC (5 years, 7 months ago) by tgl
Branches: MAIN
CVS tags: REL8_2_BETA1
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +5 -4 lines
Fix pg_locks view to call advisory locks advisory locks, while preserving
backward compatibility for anyone using the old userlock code that's now
on pgfoundry --- locks from that code still show as 'userlock'.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Mon Sep 18 22:40:40 2006 UTC (5 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +12 -5 lines
Add built-in userlock manipulation functions to replace the former
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.

Revision 1.98: download - view: text, markup, annotated - select for diffs
Sun Aug 27 19:14:34 2006 UTC (5 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +11 -8 lines
Add a function GetLockConflicts() to lock.c to report xacts holding
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.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Mon Jul 31 20:09:05 2006 UTC (5 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +1 -3 lines
Change the relation_open protocol so that we obtain lock on a relation
(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.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Sun Jul 23 23:08:46 2006 UTC (5 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +28 -14 lines
Convert the lock manager to use the new dynahash.c support for partitioned
hash tables, instead of the previous kluge involving multiple hash tables.
This partially undoes my patch of last December.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Sun Jul 23 03:07:58 2006 UTC (5 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +3 -11 lines
Split the buffer mapping table into multiple separately lockable
partitions, as per discussion.  Passes functionality checks, but
I don't have any performance data yet.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun Mar 5 15:58:59 2006 UTC (6 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +2 -2 lines
Update copyright for 2006.  Update scripts.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sun Dec 11 21:02:18 2005 UTC (6 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +11 -2 lines
Divide the lock manager's shared state into 'partitions', so as to
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.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Fri Dec 9 01:22:04 2005 UTC (6 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +68 -51 lines
Simplify lock manager data structures by making a clear separation between
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.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Sat Oct 15 02:49:46 2005 UTC (6 years, 7 months ago) by momjian
Branches: MAIN
CVS tags: REL8_1_9, REL8_1_8, REL8_1_7, REL8_1_6, REL8_1_5, REL8_1_4, REL8_1_3, REL8_1_2, REL8_1_13, REL8_1_12, REL8_1_11, REL8_1_10, REL8_1_1, REL8_1_0RC1, REL8_1_0BETA4, REL8_1_0
Branch point for: REL8_1_STABLE
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +22 -23 lines
Standard pgindent run for 8.1.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Sat Aug 20 23:26:33 2005 UTC (6 years, 8 months ago) by tgl
Branches: MAIN
CVS tags: REL8_1_0BETA3, REL8_1_0BETA2, REL8_1_0BETA1
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +2 -2 lines
Convert the arithmetic for shared memory size calculation from 'int'
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.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Fri Jun 17 22:32:50 2005 UTC (6 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +13 -4 lines
Two-phase commit.  Original patch by Heikki Linnakangas, with additional
hacking by Alvaro Herrera and Tom Lane.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Tue Jun 14 22:15:33 2005 UTC (6 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +32 -23 lines
Simplify shared-memory lock data structures as per recent discussion:
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.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Sun May 29 22:45:02 2005 UTC (6 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +11 -2 lines
Improve LockAcquire API per my recent proposal.  All error conditions
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().

Revision 1.86: download - view: text, markup, annotated - select for diffs
Thu May 19 23:30:18 2005 UTC (6 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +2 -2 lines
Factor out lock cleanup code that is needed in several places in lock.c.
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.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Fri Apr 29 22:28:24 2005 UTC (7 years ago) by tgl
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +93 -19 lines
Restructure LOCKTAG as per discussions of a couple months ago.
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.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Fri Dec 31 22:03:42 2004 UTC (7 years, 4 months ago) by pgsql
Branches: MAIN
CVS tags: REL8_0_9, REL8_0_8, REL8_0_7, REL8_0_6, REL8_0_5, REL8_0_4, REL8_0_3, REL8_0_2, REL8_0_17, REL8_0_16, REL8_0_15, REL8_0_14, REL8_0_13, REL8_0_12, REL8_0_11, REL8_0_10, REL8_0_1, REL8_0_0RC5, REL8_0_0RC4, REL8_0_0RC3, REL8_0_0
Branch point for: REL8_0_STABLE
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +2 -2 lines

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 ...

Revision 1.83: download - view: text, markup, annotated - select for diffs
Sun Aug 29 05:06:58 2004 UTC (7 years, 8 months ago) by momjian
Branches: MAIN
CVS tags: REL8_0_0RC2, REL8_0_0RC1, REL8_0_0BETA5, REL8_0_0BETA4, REL8_0_0BETA3, REL8_0_0BETA2
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +18 -16 lines
Pgindent run for 8.0.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Sun Aug 29 04:13:10 2004 UTC (7 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +2 -2 lines
Update copyright to 2004.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Fri Aug 27 17:07:42 2004 UTC (7 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +67 -24 lines
Introduce local hash table for lock state, as per recent proposal.
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.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Thu Aug 26 17:22:28 2004 UTC (7 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +25 -20 lines
Improve some comments.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sat Jul 17 03:31:26 2004 UTC (7 years, 10 months ago) by tgl
Branches: MAIN
CVS tags: REL8_0_0BETA1
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +2 -10 lines
Invent ResourceOwner mechanism as per my recent proposal, and use it to
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.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Thu Jul 1 00:51:43 2004 UTC (7 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +19 -10 lines
Nested transactions.  There is still much left to do, especially on the
performance front, but with feature freeze upon us I think it's time to
drive a stake in the ground and say that this will be in 7.5.

Alvaro Herrera, with some help from Tom Lane.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Fri May 28 05:13:29 2004 UTC (7 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +6 -3 lines
Code review for EXEC_BACKEND changes.  Reduce the number of #ifdefs by
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.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Sat Dec 20 17:31:21 2003 UTC (8 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +1 -3 lines
This patch is the next step towards (re)allowing fork/exec.

Claudio Natoli

Revision 1.75: download - view: text, markup, annotated - select for diffs
Mon Dec 1 21:59:25 2003 UTC (8 years, 5 months ago) by momjian
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +29 -27 lines
Try to reduce confusion about what is a lock method identifier, a lock
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

Revision 1.74: download - view: text, markup, annotated - select for diffs
Sat Nov 29 22:41:13 2003 UTC (8 years, 5 months ago) by pgsql
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +1 -1 lines

make sure the $Id tags are converted to $PostgreSQL as well ...

Revision 1.73: download - view: text, markup, annotated - select for diffs
Mon Aug 4 02:40:14 2003 UTC (8 years, 9 months ago) by momjian
Branches: MAIN
CVS tags: WIN32_DEV, REL7_4_STABLE, REL7_4_RC2, REL7_4_RC1, REL7_4_BETA5, REL7_4_BETA4, REL7_4_BETA3, REL7_4_BETA2, REL7_4_BETA1, REL7_4_9, REL7_4_8, REL7_4_7, REL7_4_6, REL7_4_5, REL7_4_4, REL7_4_3, REL7_4_29, REL7_4_28, REL7_4_27, REL7_4_26, REL7_4_25, REL7_4_24, REL7_4_23, REL7_4_22, REL7_4_21, REL7_4_20, REL7_4_2, REL7_4_19, REL7_4_18, REL7_4_17, REL7_4_16, REL7_4_15, REL7_4_14, REL7_4_13, REL7_4_12, REL7_4_11, REL7_4_10, REL7_4_1, REL7_4
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +2 -2 lines
Update copyrights to 2003.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Mon Aug 4 00:43:32 2003 UTC (8 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +7 -6 lines
pgindent run.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Wed Feb 19 23:41:15 2003 UTC (9 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +2 -3 lines
Back out LOCKTAG changes by Rod Taylor, pending code review. Sorry.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Wed Feb 19 04:02:54 2003 UTC (9 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +4 -3 lines
- Modifies LOCKTAG to include a 'classId'. Relation receive a classId of
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

Revision 1.69: download - view: text, markup, annotated - select for diffs
Tue Feb 18 02:13:24 2003 UTC (9 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +20 -19 lines
Rename 'holder' references to 'proclock' for PROCLOCK references, for
consistency.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Thu Jan 16 21:01:45 2003 UTC (9 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +6 -1 lines
Add code to print information about a detected deadlock cycle.  The
printed data is comparable to what you could read in the pg_locks view,
were you fortunate enough to have been looking at it at the right time.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Wed Sep 4 20:31:45 2002 UTC (9 years, 8 months ago) by momjian
Branches: MAIN
CVS tags: REL7_3_STABLE, REL7_3_9, REL7_3_8, REL7_3_7, REL7_3_6, REL7_3_5, REL7_3_4, REL7_3_21, REL7_3_20, REL7_3_2, REL7_3_19, REL7_3_18, REL7_3_17, REL7_3_16, REL7_3_15, REL7_3_14, REL7_3_13, REL7_3_12, REL7_3_11, REL7_3_10
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +9 -8 lines
pgindent run.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Sat Aug 31 17:14:28 2002 UTC (9 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +12 -11 lines
Code review for pg_locks feature.  Make shmemoffset of PROCLOCK structs
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.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sat Aug 17 13:04:18 2002 UTC (9 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +18 -1 lines
[ Newest version of patch applied.]

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

Revision 1.64: download - view: text, markup, annotated - select for diffs
Thu Aug 1 05:18:34 2002 UTC (9 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +2 -7 lines
* -Remove LockMethodTable.prio field, not used (Bruce)

Revision 1.63: download - view: text, markup, annotated - select for diffs
Fri Jul 19 00:17:40 2002 UTC (9 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +15 -15 lines
Complete TODO item:

* -HOLDER/HOLDERTAB rename to PROCLOCK/PROCLOCKTAG

Revision 1.62: download - view: text, markup, annotated - select for diffs
Thu Jul 18 23:06:20 2002 UTC (9 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +9 -23 lines
Complete TODO item:

* Merge LockMethodCtl and LockMethodTable into one shared structure (Bruce)

Revision 1.61: download - view: text, markup, annotated - select for diffs
Thu Jun 20 20:29:52 2002 UTC (9 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +2 -2 lines
Update copyright to 2002.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Tue Jun 11 13:40:52 2002 UTC (9 years, 11 months ago) by wieck
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +14 -14 lines
Katherine Ward wrote:
> 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

Revision 1.59: download - view: text, markup, annotated - select for diffs
Mon Nov 5 17:46:35 2001 UTC (10 years, 6 months ago) by momjian
Branches: MAIN
CVS tags: REL7_2_STABLE, REL7_2_RC2, REL7_2_RC1, REL7_2_BETA5, REL7_2_BETA4, REL7_2_BETA3, REL7_2_BETA2, REL7_2_8, REL7_2_7, REL7_2_6, REL7_2_5, REL7_2_4, REL7_2_3, REL7_2
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +3 -3 lines
New pgindent run with fixes suggested by Tom.  Patch manually reviewed,
initdb/regression tests pass.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sun Oct 28 06:26:09 2001 UTC (10 years, 6 months ago) by momjian
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +2 -1 lines
Another pgindent run.  Fixes enum indenting, and improves #endif
spacing.  Also adds space for one-line comments.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Thu Oct 25 05:50:10 2001 UTC (10 years, 6 months ago) by momjian
Branches: MAIN
CVS tags: REL7_2_BETA1
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +1 -2 lines
pgindent run on all C files.  Java run to follow.  initdb/regression
tests pass.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Mon Oct 1 05:36:17 2001 UTC (10 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +1 -7 lines
Another round of cleanups for dynahash.c (maybe it's finally clean of
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.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sun Sep 30 00:45:48 2001 UTC (10 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +16 -16 lines
Back out change.  Too many place to change too close to beta:

* HOLDER/HOLDERTAB rename to PROCLOCKLINK/PROCLOCKLINKTAG (Bruce)

Will return later.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Sat Sep 29 21:35:14 2001 UTC (10 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +17 -17 lines
Do this TODO item:

	* HOLDER/HOLDERTAB rename to PROCLOCK/PROCLOCKTAG (Tom)

Didn't use PROCLOCKLINK because it made PROCLOCKLINKTAG too long.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sat Sep 29 04:02:26 2001 UTC (10 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +8 -20 lines
Implement new 'lightweight lock manager' that's intermediate between
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.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Thu Sep 27 16:29:13 2001 UTC (10 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +1 -3 lines
Remove useless LockDisable() function and associated overhead, per my
proposal of 26-Aug.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Mon Jul 9 22:18:34 2001 UTC (10 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +3 -3 lines
Add SHARE UPDATE EXCLUSIVE lock mode, coming soon to a VACUUM near you.
Name chosen per pghackers discussion around 6/22/01.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Wed Jun 27 23:31:39 2001 UTC (10 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +3 -14 lines
Install infrastructure for shared-memory free space map.  Doesn't actually
do anything yet, but it has the necessary connections to initialization
and so forth.  Make some gestures towards allowing number of blocks in
a relation to be BlockNumber, ie, unsigned int, rather than signed int.
(I doubt I got all the places that are sloppy about it, yet.)  On the
way, replace the hardwired NLOCKS_PER_XACT fudge factor with a GUC
variable.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Fri Jun 22 00:04:59 2001 UTC (10 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +6 -7 lines
Add support to lock manager for conditionally locking a lock (ie,
return without waiting if we can't get the lock immediately).
Not used yet, but will be needed for concurrent VACUUM.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Thu Mar 22 04:01:07 2001 UTC (11 years, 1 month ago) by momjian
Branches: MAIN
CVS tags: REL7_1_STABLE, REL7_1_2, REL7_1
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +21 -18 lines
pgindent run.  Make it all clean.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Fri Feb 23 19:24:06 2001 UTC (11 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +9 -1 lines
Update comments on locks.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Fri Feb 23 18:28:46 2001 UTC (11 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +4 -3 lines
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Is there one LOCKMETHODCTL for every backend?  I thought there was only
> one of them.
>>
>> You're right, that line is erroneous; it should read
>>
>> size += MAX_LOCK_METHODS * MAXALIGN(sizeof(LOCKMETHODCTL));
>>
>> Not a significant error but it should be changed for clarity ...

Revision 1.45: download - view: text, markup, annotated - select for diffs
Thu Feb 22 23:02:33 2001 UTC (11 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +2 -2 lines
More comment improvements.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Thu Jan 25 03:31:16 2001 UTC (11 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +9 -5 lines
Re-implement deadlock detection and resolution, per design notes posted
to pghackers on 18-Jan-01.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Wed Jan 24 19:43:27 2001 UTC (11 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +2 -2 lines
Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Mon Jan 22 22:30:06 2001 UTC (11 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +17 -8 lines
Clean up lockmanager data structures some more, in preparation for planned
rewrite of deadlock checking.  Lock holder objects are now reachable from
the associated LOCK as well as from the owning PROC.  This makes it
practical to find all the processes holding a lock, as well as all those
waiting on the lock.  Also, clean up some of the grottier aspects of the
SHMQueue API, and cause the waitProcs list to be stored in the intuitive
direction instead of the nonintuitive one.  (Bet you didn't know that
the code followed the 'prev' link to get to the next waiting process,
instead of the 'next' link.  It doesn't do that anymore.)

Revision 1.41: download - view: text, markup, annotated - select for diffs
Tue Jan 16 06:11:34 2001 UTC (11 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +28 -20 lines
Rename fields of lock and lockholder structures to something a tad less
confusing, and clean up documentation.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Fri Dec 22 00:51:54 2000 UTC (11 years, 4 months ago) by tgl
Branches: MAIN
CVS tags: REL7_1_BETA3, REL7_1_BETA2
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +104 -125 lines
Revise lock manager to support "session level" locks as well as "transaction
level" locks.  A session lock is not released at transaction commit (but it
is released on transaction abort, to ensure recovery after an elog(ERROR)).
In VACUUM, use a session lock to protect the master table while vacuuming a
TOAST table, so that the TOAST table can be done in an independent
transaction.

I also took this opportunity to do some cleanup and renaming in the lock
code.  The previously noted bug in ProcLockWakeup, that it couldn't wake up
any waiters beyond the first non-wakeable waiter, is now fixed.  Also found
a previously unknown bug of the same kind (failure to scan all members of
a lock queue in some cases) in DeadLockCheck.  This might have led to failure
to detect a deadlock condition, resulting in indefinite waits, but it's
difficult to characterize the conditions required to trigger a failure.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Jul 17 03:05:30 2000 UTC (11 years, 10 months ago) by tgl
Branches: MAIN
CVS tags: REL7_1_BETA
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +1 -3 lines
Revise aggregate functions per earlier discussions in pghackers.
There's now only one transition value and transition function.
NULL handling in aggregates is a lot cleaner.  Also, use Numeric
accumulators instead of integer accumulators for sum/avg on integer
datatypes --- this avoids overflow at the cost of being a little slower.
Implement VARIANCE() and STDDEV() aggregates in the standard backend.

Also, enable new LIKE selectivity estimators by default.  Unrelated
change, but as long as I had to force initdb anyway...

Revision 1.38: download - view: text, markup, annotated - select for diffs
Wed May 31 00:28:38 2000 UTC (11 years, 11 months ago) by petere
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +12 -3 lines
The heralded `Grand Unified Configuration scheme' (GUC)

That means you can now set your options in either or all of $PGDATA/configuration,
some postmaster option (--enable-fsync=off), or set a SET command. The list of
options is in backend/utils/misc/guc.c, documentation will be written post haste.

pg_options is gone, so is that pq_geqo config file. Also removed were backend -K,
-Q, and -T options (no longer applicable, although -d0 does the same as -Q).

Added to configure an --enable-syslog option.

changed all callers from TPRINTF to elog(DEBUG)

Revision 1.37: download - view: text, markup, annotated - select for diffs
Wed Apr 12 17:16:51 2000 UTC (12 years, 1 month ago) by momjian
Branches: MAIN
CVS tags: REL7_0_PATCHES, REL7_0
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +14 -12 lines
Ye-old pgindent run.  Same 4-space tabs.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Wed Jan 26 05:58:33 2000 UTC (12 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +3 -2 lines
Add:

  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc

to all files copyright Regents of Berkeley.  Man, that's a lot of files.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sat Jan 15 02:59:42 2000 UTC (12 years, 4 months ago) by petere
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +1 -2 lines
Fixed all elog related warnings, as well as a few others.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Mon Sep 6 19:37:37 1999 UTC (12 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +2 -2 lines
I finally understood what sinvaladt.c is doing --- and it
offended my aesthestic sensibility that there was so much unreadable code
doing so little.  Rewritten code is about half the size, faster, and
(I hope) much more intelligible.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Fri Jul 16 17:07:38 1999 UTC (12 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +2 -2 lines
More cleanup

Revision 1.32: download - view: text, markup, annotated - select for diffs
Thu Jul 15 23:04:12 1999 UTC (12 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +5 -5 lines
Change #include's to use <> and "" as appropriate.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Thu Jul 15 20:32:29 1999 UTC (12 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +4 -4 lines
Cleanups.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Jun 1 09:35:39 1999 UTC (12 years, 11 months ago) by vadim
Branches: MAIN
CVS tags: REL6_5_PATCHES, REL6_5
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +12 -7 lines
typedef struct LTAG
{
    Oid             relId;
    Oid             dbId;
    union
    {
        BlockNumber     blkno;
        TransactionId   xid;
    }               objId;
>
> Added:
>    /*
>     * offnum should be part of objId.tupleId above, but would increase
>     * sizeof(LOCKTAG) and so moved here; currently used by userlocks only.
>     */
>    OffsetNumber    offnum;
    uint16          lockmethod;     /* needed by userlocks */
} LOCKTAG;

gmake clean required...
User locks are ready for 6.5 release...

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sat May 29 06:14:42 1999 UTC (12 years, 11 months ago) by vadim
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +3 -2 lines
Fix xid table sizing.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Tue May 25 22:43:26 1999 UTC (12 years, 11 months ago) by momjian
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +3 -3 lines
Another pgindent run.  Sorry folks.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Tue May 25 16:14:42 1999 UTC (12 years, 11 months ago) by momjian
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +4 -4 lines
pgindent run over code.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Thu May 13 15:55:44 1999 UTC (13 years ago) by momjian
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +2 -3 lines
Hi, Bruce!

These are my last changes to lmgr fixing deadlock handling.
Please apply them to cvs...

Vadim

Revision 1.25: download - view: text, markup, annotated - select for diffs
Fri May 7 01:23:07 1999 UTC (13 years ago) by vadim
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +3 -2 lines
Fix LMGR for MVCC.
Get rid of Extend lock mode.

Revision 1.19.2.1: download - view: text, markup, annotated - select for diffs
Sun Mar 7 02:00:47 1999 UTC (13 years, 2 months ago) by tgl
Branches: REL6_4
Diff to: previous 1.19: preferred, colored; next MAIN 1.20: preferred, colored
Changes since revision 1.19: +7 -1 lines
Retrofit hashtable and shared-mem-size-estimation bug fixes
into REL6_4.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sat Mar 6 21:17:43 1999 UTC (13 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +7 -3 lines
A few further tweaks to shared memory space estimation.
This change brings the default size of the main shmem block back under 1MB,
which is a fairly popular value for the kernel's SHMMAX parameter.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Sun Feb 21 01:41:47 1999 UTC (13 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +5 -5 lines
Rearrange handling of MAXBACKENDS a little bit.  The default setting
of MAXBACKENDS is now 1024, since all it's costing is about 32 bytes of memory
per array slot.  configure's --with-maxbackends switch now controls DEF_MAXBACKENDS
which is simply the default value of the postmaster's -N switch.  Thus,
the out-of-the-box configuration will still limit you to 64 backends,
but you can go up to 1024 backends simply by restarting the postmaster with
a different -N switch --- no rebuild required.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri Feb 19 06:06:35 1999 UTC (13 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +4 -5 lines
Allow maximum number of backends to be set at configure time
(--with-maxbackends).  Add a postmaster switch (-N backends) that allows
the limit to be reduced at postmaster start time.  (You can't increase it,
sorry to say, because there are still some fixed-size arrays.)
Grab the number of semaphores indicated by min(MAXBACKENDS, -N) at
postmaster startup, so that this particular form of bogus configuration
is exposed immediately rather than under heavy load.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sat Feb 13 23:22:07 1999 UTC (13 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +3 -3 lines
Change my-function-name-- to my_function_name, and optimizer renames.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Dec 15 12:46:58 1998 UTC (13 years, 5 months ago) by vadim
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +6 -6 lines
Initial MVCC code.
New code for locking buffer' context.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Thu Oct 8 18:30:45 1998 UTC (13 years, 7 months ago) by momjian
Branches: MAIN
Branch point for: REL6_4
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +1 -2 lines
Make functions static or ifdef NOT_USED.  Prevent pg_version creation.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue Sep 1 04:38:24 1998 UTC (13 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +17 -16 lines
OK, folks, here is the pgindent output.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Tue Aug 25 21:20:31 1998 UTC (13 years, 8 months ago) by scrappy
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +42 -16 lines

From: Massimo Dal Zotto <dz@cs.unitn.it>

lock.patch

        I have rewritten lock.c cleaning up the code and adding better
        assert checking I have also added some fields to the lock and
        xid tags for better support of user locks. There is also a new
        function which returns an array of pids owning a lock.
        I'm using this code from over six months and it works fine.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Aug 1 15:26:37 1998 UTC (13 years, 9 months ago) by vadim
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +6 -2 lines
Lmgr cleanup, new locking modes for LLL.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Tue Jun 30 02:33:33 1998 UTC (13 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +36 -37 lines
Rename locking structure names to be clearer.  Add narrative to
backend flowchart.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Jun 28 21:17:35 1998 UTC (13 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +8 -8 lines
Rename lockt to locktype and rename LOCKT to LOCKTYPE.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Fri Jun 26 01:58:46 1998 UTC (13 years, 10 months ago) by momjian
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +2 -2 lines
Rename LockTab to LockTable in function name.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Jun 15 18:40:03 1998 UTC (13 years, 11 months ago) by momjian
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +5 -3 lines
Fix macros that were not properly surrounded by parens or braces.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Thu Feb 26 04:43:28 1998 UTC (14 years, 2 months ago) by momjian
Branches: MAIN
CVS tags: release-6-3
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +6 -3 lines
pgindent run before 6.3 release, with Thomas' requested changes.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Tue Jan 27 03:00:43 1998 UTC (14 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -2 lines
Real deadlock detection.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sat Jan 24 22:50:11 1998 UTC (14 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +3 -5 lines
Fix prototypes so they don't look like function definitions.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Mon Sep 8 21:54:31 1997 UTC (14 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +15 -15 lines
Used modified version of indent that understands over 100 typedefs.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Mon Sep 8 02:39:05 1997 UTC (14 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +48 -48 lines
Another PGINDENT run that changes variable indenting and case label indenting.  Also static variable indenting.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sun Sep 7 05:01:26 1997 UTC (14 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +92 -82 lines
Massive commit to run PGINDENT on all *.c and *.h files.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Tue Aug 19 21:39:55 1997 UTC (14 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +1 -4 lines
Make functions static where possible, enclose unused functions in #ifdef NOT_USED.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Wed Feb 12 05:25:13 1997 UTC (15 years, 3 months ago) by scrappy
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +5 -1 lines
Patch from Massimo Dal Zotto <dz@cs.unitn.it>

The following patches add to the backend a new debugging flag -K which prints
a debug trace of all locking operations on user relations (those with oid
greater than 20000). The code is compiled only if LOCK_MGR_DEBUG is defined,
so the patch should be harmless if not explicitly enabled.
I'm using the code to trace deadlock conditions caused by application queries
using the command "$POSTMASTER -D $PGDATA -o '-d 1 -K 1'.
The patches are for version 6.0 dated 970126.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Nov 5 06:11:00 1996 UTC (15 years, 6 months ago) by scrappy
Branches: MAIN
CVS tags: REL2_0B, REL2_0
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +3 -6 lines
Another directory totally cleaned out

Revision 1.2: download - view: text, markup, annotated - select for diffs
Thu Oct 31 09:49:57 1996 UTC (15 years, 6 months ago) by scrappy
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +1 -2 lines
remove:
	#include "postgres.h"
	#include "c.h"

Revision 1.1: download - view: text, markup, annotated - select for diffs
Wed Aug 28 01:58:15 1996 UTC (15 years, 8 months ago) by scrappy
Branches: MAIN
More cleanups of the include files

	- centralizing to simplify the -I's required to compile

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

PostgreSQL CVSweb <webmaster@postgresql.org>