diff options
author | Vadim B. Mikheev <vadim4o@yahoo.com> | 1999-06-10 14:17:12 +0000 |
---|---|---|
committer | Vadim B. Mikheev <vadim4o@yahoo.com> | 1999-06-10 14:17:12 +0000 |
commit | 78f7ccc9822bc5b2206c36308640e2aad94e4f55 (patch) | |
tree | 904e731545537362897de3c5161ad99284dca5b3 /src/backend/storage/buffer/bufmgr.c | |
parent | c37ecaf8d558d4e6415417adba7191934202e1d2 (diff) | |
download | postgresql-78f7ccc9822bc5b2206c36308640e2aad94e4f55.tar.gz postgresql-78f7ccc9822bc5b2206c36308640e2aad94e4f55.zip |
1. Fix for elog(ERROR, "EvalPlanQual: t_xmin is uncommitted ?!")
and possibly for other cases too:
DO NOT cache status of transaction in unknown state
(i.e. non-committed and non-aborted ones)
Example:
T1 reads row updated/inserted by running T2 and cache T2 status.
T2 commits.
Now T1 reads a row updated by T2 and with HEAP_XMAX_COMMITTED
in t_infomask (so cached T2 status is not changed).
Now T1 EvalPlanQual gets updated row version without HEAP_XMIN_COMMITTED
-> TransactionIdDidCommit(t_xmin) and TransactionIdDidAbort(t_xmin)
return FALSE and T2 decides that t_xmin is not committed and gets
ERROR above.
It's too late to find more smart way to handle such cases and so
I just changed xact status caching and got rid TransactionIdFlushCache()
from code.
Changed: transam.c, xact.c, lmgr.c and transam.h - last three
just because of TransactionIdFlushCache() is removed.
2. heapam.c:
T1 marked a row for update. T2 waits for T1 commit/abort.
T1 commits. T3 updates the row before T2 locks row page.
Now T2 sees that new row t_xmax is different from xact id (T1)
T2 was waiting for. Old code did Assert here. New one goes to
HeapTupleSatisfiesUpdate. Obvious changes too.
3. Added Assert to vacuum.c
4. bufmgr.c: break
Assert(buf->r_locks == 0 && !buf->ri_lock)
into two Asserts.
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r-- | src/backend/storage/buffer/bufmgr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 9b7a41b4cb8..f0b397dbea4 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.53 1999/05/29 03:58:43 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.54 1999/06/10 14:17:09 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -2007,7 +2007,8 @@ LockBuffer(Buffer buffer, int mode) else if (BufferLocks[buffer - 1] & BL_W_LOCK) { Assert(buf->w_lock); - Assert(buf->r_locks == 0 && !buf->ri_lock); + Assert(buf->r_locks == 0); + Assert(!buf->ri_lock); Assert(!(BufferLocks[buffer - 1] & (BL_R_LOCK | BL_RI_LOCK))) buf->w_lock = false; BufferLocks[buffer - 1] &= ~BL_W_LOCK; |