diff options
| author | Thomas Munro | 2020-01-28 00:13:04 +0000 |
|---|---|---|
| committer | Thomas Munro | 2020-01-28 00:13:04 +0000 |
| commit | 6f38d4dac381b5b8bead302a0b4f81761042cd25 (patch) | |
| tree | 93c4f33eb15be92bc1b24ea5bee97f1201dfbbd0 /src/include | |
| parent | 4589c6a2a30faba53d0655a8e3a29b54d28bb6f6 (diff) | |
Remove dependency on HeapTuple from predicate locking functions.
The following changes make the predicate locking functions more
generic and suitable for use by future access methods:
- PredicateLockTuple() is renamed to PredicateLockTID(). It takes
ItemPointer and inserting transaction ID instead of HeapTuple.
- CheckForSerializableConflictIn() takes blocknum instead of buffer.
- CheckForSerializableConflictOut() no longer takes HeapTuple or buffer.
Author: Ashwin Agrawal
Reviewed-by: Andres Freund, Kuntal Ghosh, Thomas Munro
Discussion: https://postgr.es/m/CALfoeiv0k3hkEb3Oqk%3DziWqtyk2Jys1UOK5hwRBNeANT_yX%2Bng%40mail.gmail.com
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/heapam.h | 2 | ||||
| -rw-r--r-- | src/include/storage/predicate.h | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index 00a17f5f717..47fda28daa1 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -220,5 +220,7 @@ extern bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data, HeapTuple htup, Buffer buffer, CommandId *cmin, CommandId *cmax); +extern void HeapCheckForSerializableConflictOut(bool valid, Relation relation, HeapTuple tuple, + Buffer buffer, Snapshot snapshot); #endif /* HEAPAM_H */ diff --git a/src/include/storage/predicate.h b/src/include/storage/predicate.h index a6cc1a1bf04..9df44ed0dc7 100644 --- a/src/include/storage/predicate.h +++ b/src/include/storage/predicate.h @@ -57,16 +57,17 @@ extern void SetSerializableTransactionSnapshot(Snapshot snapshot, extern void RegisterPredicateLockingXid(TransactionId xid); extern void PredicateLockRelation(Relation relation, Snapshot snapshot); extern void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot); -extern void PredicateLockTuple(Relation relation, HeapTuple tuple, Snapshot snapshot); +extern void PredicateLockTID(Relation relation, ItemPointer tid, Snapshot snapshot, + TransactionId insert_xid); extern void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno); extern void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno); extern void TransferPredicateLocksToHeapRelation(Relation relation); extern void ReleasePredicateLocks(bool isCommit, bool isReadOnlySafe); /* conflict detection (may also trigger rollback) */ -extern void CheckForSerializableConflictOut(bool valid, Relation relation, HeapTuple tuple, - Buffer buffer, Snapshot snapshot); -extern void CheckForSerializableConflictIn(Relation relation, HeapTuple tuple, Buffer buffer); +extern bool CheckForSerializableConflictOutNeeded(Relation relation, Snapshot snapshot); +extern void CheckForSerializableConflictOut(Relation relation, TransactionId xid, Snapshot snapshot); +extern void CheckForSerializableConflictIn(Relation relation, ItemPointer tid, BlockNumber blkno); extern void CheckTableForSerializableConflictIn(Relation relation); /* final rollback checking */ |
