diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2011-05-30 20:42:16 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2011-05-30 20:47:17 +0300 |
commit | 3103f9a77d005f9d8b8ef492298bbbbf6c4b843f (patch) | |
tree | 90c6388951c3cd43f284a88a3ea379513e0e3afc /src/backend/access/heap/heapam.c | |
parent | 5177dfefc532ea481bf70d1bb8a493f835a9c57c (diff) | |
download | postgresql-3103f9a77d005f9d8b8ef492298bbbbf6c4b843f.tar.gz postgresql-3103f9a77d005f9d8b8ef492298bbbbf6c4b843f.zip |
The row-version chaining in Serializable Snapshot Isolation was still wrong.
On further analysis, it turns out that it is not needed to duplicate predicate
locks to the new row version at update, the lock on the version that the
transaction saw as visible is enough. However, there was a different bug in
the code that checks for dangerous structures when a new rw-conflict happens.
Fix that bug, and remove all the row-version chaining related code.
Kevin Grittner & Dan Ports, with some comment editorialization by me.
Diffstat (limited to 'src/backend/access/heap/heapam.c')
-rw-r--r-- | src/backend/access/heap/heapam.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 346d6b964d5..01a492e496e 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -1529,7 +1529,6 @@ heap_hot_search_buffer(ItemPointer tid, Relation relation, Buffer buffer, OffsetNumber offnum; bool at_chain_start; bool valid; - bool match_found; if (all_dead) *all_dead = true; @@ -1539,7 +1538,6 @@ heap_hot_search_buffer(ItemPointer tid, Relation relation, Buffer buffer, Assert(ItemPointerGetBlockNumber(tid) == BufferGetBlockNumber(buffer)); offnum = ItemPointerGetOffsetNumber(tid); at_chain_start = true; - match_found = false; /* Scan through possible multiple members of HOT-chain */ for (;;) @@ -1597,10 +1595,7 @@ heap_hot_search_buffer(ItemPointer tid, Relation relation, Buffer buffer, PredicateLockTuple(relation, &heapTuple); if (all_dead) *all_dead = false; - if (IsolationIsSerializable()) - match_found = true; - else - return true; + return true; } /* @@ -1629,7 +1624,7 @@ heap_hot_search_buffer(ItemPointer tid, Relation relation, Buffer buffer, break; /* end of chain */ } - return match_found; + return false; } /* @@ -2855,12 +2850,6 @@ l2: END_CRIT_SECTION(); - /* - * Any existing SIREAD locks on the old tuple must be linked to the new - * tuple for conflict detection purposes. - */ - PredicateLockTupleRowVersionLink(relation, &oldtup, heaptup); - if (newbuf != buffer) LockBuffer(newbuf, BUFFER_LOCK_UNLOCK); LockBuffer(buffer, BUFFER_LOCK_UNLOCK); |