diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-09-08 20:31:15 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-09-08 20:31:15 +0000 |
commit | 6bd4f401b0cb85f2e81caffc457e415e15e2ed5d (patch) | |
tree | a0edebb698a1a288be3e66c064c36399cbf5f93f /src/backend/storage/lmgr/proc.c | |
parent | 0a51e7073c045b5fce50092dae19f398f7b38e16 (diff) | |
download | postgresql-6bd4f401b0cb85f2e81caffc457e415e15e2ed5d.tar.gz postgresql-6bd4f401b0cb85f2e81caffc457e415e15e2ed5d.zip |
Replace the former method of determining snapshot xmax --- to wit, calling
ReadNewTransactionId from GetSnapshotData --- with a "latestCompletedXid"
variable that is updated during transaction commit or abort. Since
latestCompletedXid is written only in places that had to lock ProcArrayLock
exclusively anyway, and is read only in places that had to lock ProcArrayLock
shared anyway, it adds no new locking requirements to the system despite being
cluster-wide. Moreover, removing ReadNewTransactionId from snapshot
acquisition eliminates the need to take both XidGenLock and ProcArrayLock at
the same time. Since XidGenLock is sometimes held across I/O this can be a
significant win. Some preliminary benchmarking suggested that this patch has
no effect on average throughput but can significantly improve the worst-case
transaction times seen in pgbench. Concept by Florian Pflug, implementation
by Tom Lane.
Diffstat (limited to 'src/backend/storage/lmgr/proc.c')
-rw-r--r-- | src/backend/storage/lmgr/proc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c index 5441dd322de..ddebdcc5e2a 100644 --- a/src/backend/storage/lmgr/proc.c +++ b/src/backend/storage/lmgr/proc.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.193 2007/09/05 18:10:47 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.194 2007/09/08 20:31:15 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -581,7 +581,7 @@ static void RemoveProcFromArray(int code, Datum arg) { Assert(MyProc != NULL); - ProcArrayRemove(MyProc); + ProcArrayRemove(MyProc, InvalidTransactionId); } /* |