229 #define TargetTagIsCoveredBy(covered_target, covering_target) \
230 ((GET_PREDICATELOCKTARGETTAG_RELATION(covered_target) == \
231 GET_PREDICATELOCKTARGETTAG_RELATION(covering_target)) \
232 && (GET_PREDICATELOCKTARGETTAG_OFFSET(covering_target) == \
233 InvalidOffsetNumber) \
234 && (((GET_PREDICATELOCKTARGETTAG_OFFSET(covered_target) != \
235 InvalidOffsetNumber) \
236 && (GET_PREDICATELOCKTARGETTAG_PAGE(covering_target) == \
237 GET_PREDICATELOCKTARGETTAG_PAGE(covered_target))) \
238 || ((GET_PREDICATELOCKTARGETTAG_PAGE(covering_target) == \
239 InvalidBlockNumber) \
240 && (GET_PREDICATELOCKTARGETTAG_PAGE(covered_target) \
241 != InvalidBlockNumber))) \
242 && (GET_PREDICATELOCKTARGETTAG_DB(covered_target) == \
243 GET_PREDICATELOCKTARGETTAG_DB(covering_target)))
252 #define PredicateLockHashPartition(hashcode) \
253 ((hashcode) % NUM_PREDICATELOCK_PARTITIONS)
254 #define PredicateLockHashPartitionLock(hashcode) \
255 (&MainLWLockArray[PREDICATELOCK_MANAGER_LWLOCK_OFFSET + \
256 PredicateLockHashPartition(hashcode)].lock)
257 #define PredicateLockHashPartitionLockByIndex(i) \
258 (&MainLWLockArray[PREDICATELOCK_MANAGER_LWLOCK_OFFSET + (i)].lock)
260 #define NPREDICATELOCKTARGETENTS() \
261 mul_size(max_predicate_locks_per_xact, add_size(MaxBackends, max_prepared_xacts))
263 #define SxactIsOnFinishedList(sxact) (!dlist_node_is_detached(&(sxact)->finishedLink))
273 #define SxactIsCommitted(sxact) (((sxact)->flags & SXACT_FLAG_COMMITTED) != 0)
274 #define SxactIsPrepared(sxact) (((sxact)->flags & SXACT_FLAG_PREPARED) != 0)
275 #define SxactIsRolledBack(sxact) (((sxact)->flags & SXACT_FLAG_ROLLED_BACK) != 0)
276 #define SxactIsDoomed(sxact) (((sxact)->flags & SXACT_FLAG_DOOMED) != 0)
277 #define SxactIsReadOnly(sxact) (((sxact)->flags & SXACT_FLAG_READ_ONLY) != 0)
278 #define SxactHasSummaryConflictIn(sxact) (((sxact)->flags & SXACT_FLAG_SUMMARY_CONFLICT_IN) != 0)
279 #define SxactHasSummaryConflictOut(sxact) (((sxact)->flags & SXACT_FLAG_SUMMARY_CONFLICT_OUT) != 0)
285 #define SxactHasConflictOut(sxact) (((sxact)->flags & SXACT_FLAG_CONFLICT_OUT) != 0)
286 #define SxactIsDeferrableWaiting(sxact) (((sxact)->flags & SXACT_FLAG_DEFERRABLE_WAITING) != 0)
287 #define SxactIsROSafe(sxact) (((sxact)->flags & SXACT_FLAG_RO_SAFE) != 0)
288 #define SxactIsROUnsafe(sxact) (((sxact)->flags & SXACT_FLAG_RO_UNSAFE) != 0)
289 #define SxactIsPartiallyReleased(sxact) (((sxact)->flags & SXACT_FLAG_PARTIALLY_RELEASED) != 0)
299 #define PredicateLockTargetTagHashCode(predicatelocktargettag) \
300 get_hash_value(PredicateLockTargetHash, predicatelocktargettag)
312 #define PredicateLockHashCodeFromTargetHashCode(predicatelocktag, targethash) \
313 ((targethash) ^ ((uint32) PointerGetDatum((predicatelocktag)->myXact)) \
314 << LOG2_NUM_PREDICATELOCK_PARTITIONS)
322 #define SerialSlruCtl (&SerialSlruCtlData)
324 #define SERIAL_PAGESIZE BLCKSZ
325 #define SERIAL_ENTRYSIZE sizeof(SerCommitSeqNo)
326 #define SERIAL_ENTRIESPERPAGE (SERIAL_PAGESIZE / SERIAL_ENTRYSIZE)
331 #define SERIAL_MAX_PAGE (MaxTransactionId / SERIAL_ENTRIESPERPAGE)
333 #define SerialNextPage(page) (((page) >= SERIAL_MAX_PAGE) ? 0 : (page) + 1)
335 #define SerialValue(slotno, xid) (*((SerCommitSeqNo *) \
336 (SerialSlruCtl->shared->page_buffer[slotno] + \
337 ((((uint32) (xid)) % SERIAL_ENTRIESPERPAGE) * SERIAL_ENTRYSIZE))))
339 #define SerialPage(xid) (((uint32) (xid)) / SERIAL_ENTRIESPERPAGE)
630 if (conflict->
sxactIn == writer)
648 (
errcode(ERRCODE_OUT_OF_MEMORY),
649 errmsg(
"not enough elements in RWConflictPool to record a read/write conflict"),
650 errhint(
"You might need to run fewer transactions at a time or increase max_connections.")));
667 Assert(roXact != activeXact);
673 (
errcode(ERRCODE_OUT_OF_MEMORY),
674 errmsg(
"not enough elements in RWConflictPool to record a potential read/write conflict"),
675 errhint(
"You might need to run fewer transactions at a time or increase max_connections.")));
741 #ifdef USE_ASSERT_CHECKING
743 SerialPagePrecedesLogicallyUnitTests(
void)
746 offset = per_page / 2;
756 newestXact = newestPage * per_page + offset;
757 Assert(newestXact / per_page == newestPage);
758 oldestXact = newestXact + 1;
759 oldestXact -= 1U << 31;
760 oldestPage = oldestXact / per_page;
772 targetPage = oldestPage;
790 targetPage = newestPage;
813 #ifdef USE_ASSERT_CHECKING
814 SerialPagePrecedesLogicallyUnitTests();
891 while (firstZeroPage != targetPage)
1092 long max_table_size;
1096 #ifndef EXEC_BACKEND
1148 max_table_size *= 2;
1171 max_table_size *= 10;
1194 for (
i = 0;
i < max_table_size;
i++)
1245 max_table_size *= 5;
1261 for (
i = 0;
i < max_table_size;
i++)
1294 long max_table_size;
1302 max_table_size *= 2;
1314 max_table_size *= 10;
1324 max_table_size *= 5;
1400 data->nelements = els;
1539 errmsg_internal(
"deferrable snapshot was unsafe; trying a new one")));
1564 int num_written = 0;
1576 if (sxact->
pid == blocked_pid)
1578 blocking_sxact = sxact;
1594 if (num_written >= output_size)
1628 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1629 errmsg(
"cannot use serializable mode in a hot standby"),
1630 errdetail(
"\"default_transaction_isolation\" is set to \"serializable\"."),
1631 errhint(
"You can use \"SET default_transaction_isolation = 'repeatable read'\" to change the default.")));
1681 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
1682 errmsg(
"a snapshot-importing transaction must not be READ ONLY DEFERRABLE")));
1718 elog(
ERROR,
"cannot establish serializable snapshot during a parallel operation");
1736 #ifdef TEST_SUMMARIZE_SERIAL
1760 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
1761 errmsg(
"could not import the requested snapshot"),
1762 errdetail(
"The source process with PID %d is not running anymore.",
1959 &targettag, targettaghash,
1963 return (target != NULL);
2050 targettag = *newtargettag;
2055 targettag = parenttag;
2132 Assert(rmtarget == target);
2167 oldlocktag = predlock->
tag;
2170 oldtargettag = oldtarget->
tag;
2191 Assert(rmpredlock == predlock);
2271 targettag = *reqtag;
2276 targettag = nexttag;
2283 parentlock->
held =
false;
2298 promotiontag = targettag;
2330 parenttag = *targettag;
2338 parenttag = nexttag;
2342 &parenttag, targettaghash,
2350 if (parentlock == NULL)
2370 &parenttag, targettaghash,
2372 Assert(rmlock == parentlock);
2407 targettag, targettaghash,
2411 (
errcode(ERRCODE_OUT_OF_MEMORY),
2412 errmsg(
"out of shared memory"),
2413 errhint(
"You might need to increase %s.",
"max_pred_locks_per_transaction")));
2426 (
errcode(ERRCODE_OUT_OF_MEMORY),
2427 errmsg(
"out of shared memory"),
2428 errhint(
"You might need to increase %s.",
"max_pred_locks_per_transaction")));
2470 targettag, targettaghash,
2472 locallock->
held =
true;
2669 LWLock *oldpartitionLock;
2672 LWLock *newpartitionLock;
2674 bool outOfShmem =
false;
2698 if (oldpartitionLock < newpartitionLock)
2704 else if (oldpartitionLock > newpartitionLock)
2746 newpredlocktag.
myTarget = newtarget;
2822 if (oldpartitionLock < newpartitionLock)
2827 else if (oldpartitionLock > newpartitionLock)
2882 uint32 heaptargettaghash;
2897 relId = relation->
rd_id;
2906 heapId = relation->
rd_index->indrelid;
2909 Assert(transfer || !isIndex);
2913 heaptargettaghash = 0;
2943 if (transfer && !isIndex
2958 if (transfer && heaptarget == NULL)
3006 newpredlocktag.
myTarget = heaptarget;
3007 newpredlocktag.
myXact = oldXact;
3101 Assert(oldblkno != newblkno);
3248 bool partiallyReleasing =
false;
3262 bool topLevelIsDeclaredReadOnly;
3265 Assert(!(isCommit && isReadOnlySafe));
3268 if (!isReadOnlySafe)
3347 partiallyReleasing =
true;
3416 if (!topLevelIsDeclaredReadOnly)
3507 if (!topLevelIsDeclaredReadOnly)
3520 roXact = possibleUnsafeConflict->
sxactIn;
3570 needToClear =
false;
3571 if ((partiallyReleasing ||
3704 bool canDoPartialCleanup;
3716 if (canDoPartialCleanup)
3724 tag = predlock->
tag;
3726 targettag = target->
tag;
3797 tag = predlock->
tag;
3799 targettag = target->
tag;
3823 (
errcode(ERRCODE_OUT_OF_MEMORY),
3824 errmsg(
"out of shared memory"),
3825 errhint(
"You might need to increase %s.",
"max_pred_locks_per_transaction")));
3935 errmsg(
"could not serialize access due to read/write dependencies among transactions"),
3936 errdetail_internal(
"Reason code: Canceled on identification as a pivot, during conflict out checking."),
3937 errhint(
"The transaction might succeed if retried.")));
3971 errmsg(
"could not serialize access due to read/write dependencies among transactions"),
3972 errdetail_internal(
"Reason code: Canceled on identification as a pivot, during conflict out checking."),
3973 errhint(
"The transaction might succeed if retried.")));
3996 if (conflictCommitSeqNo != 0)
4000 || conflictCommitSeqNo
4004 errmsg(
"could not serialize access due to read/write dependencies among transactions"),
4006 errhint(
"The transaction might succeed if retried.")));
4012 errmsg(
"could not serialize access due to read/write dependencies among transactions"),
4013 errdetail_internal(
"Reason code: Canceled on identification as a pivot, with conflict out to old committed transaction %u.", xid),
4014 errhint(
"The transaction might succeed if retried.")));
4051 errmsg(
"could not serialize access due to read/write dependencies among transactions"),
4053 errhint(
"The transaction might succeed if retried.")));
4119 targettag, targettaghash,
4155 mypredlock = predlock;
4156 mypredlocktag = predlock->
tag;
4196 if (mypredlock != NULL)
4213 (&mypredlocktag, targettaghash);
4219 if (rmpredlock != NULL)
4221 Assert(rmpredlock == mypredlock);
4231 Assert(rmpredlock == mypredlock);
4242 if (rmpredlock != NULL)
4250 targettag, targettaghash,
4281 errmsg(
"could not serialize access due to read/write dependencies among transactions"),
4282 errdetail_internal(
"Reason code: Canceled on identification as a pivot, during conflict in checking."),
4283 errhint(
"The transaction might succeed if retried.")));
4382 heapId = relation->
rd_id;
4437 Assert(reader != writer);
4600 errmsg(
"could not serialize access due to read/write dependencies among transactions"),
4601 errdetail_internal(
"Reason code: Canceled on identification as a pivot, during write."),
4602 errhint(
"The transaction might succeed if retried.")));
4612 errmsg(
"could not serialize access due to read/write dependencies among transactions"),
4614 errhint(
"The transaction might succeed if retried.")));
4659 errmsg(
"could not serialize access due to read/write dependencies among transactions"),
4660 errdetail_internal(
"Reason code: Canceled on identification as a pivot, during commit attempt."),
4661 errhint(
"The transaction might succeed if retried.")));
4695 errmsg(
"could not serialize access due to read/write dependencies among transactions"),
4696 errdetail_internal(
"Reason code: Canceled on commit attempt with conflict in from prepared pivot."),
4697 errhint(
"The transaction might succeed if retried.")));
4752 &record,
sizeof(record));
4779 &record,
sizeof(record));
4870 (
errcode(ERRCODE_OUT_OF_MEMORY),
4871 errmsg(
"out of shared memory")));
bool ParallelContextActive(void)
#define InvalidBlockNumber
static bool BlockNumberIsValid(BlockNumber blockNumber)
#define unconstify(underlying_type, expr)
#define PG_USED_FOR_ASSERTS_ONLY
uint32 LocalTransactionId
elog(ERROR, "%s: %s", p2, msg)
void hash_destroy(HTAB *hashp)
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
long hash_get_num_entries(HTAB *hashp)
Size hash_estimate_size(long num_entries, Size entrysize)
void * hash_search_with_hash_value(HTAB *hashp, const void *keyPtr, uint32 hashvalue, HASHACTION action, bool *foundPtr)
void * hash_seq_search(HASH_SEQ_STATUS *status)
void hash_seq_init(HASH_SEQ_STATUS *status, HTAB *hashp)
int errmsg_internal(const char *fmt,...)
int errdetail_internal(const char *fmt,...)
int errdetail(const char *fmt,...)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define dlist_foreach(iter, lhead)
static void dlist_init(dlist_head *head)
#define dlist_head_element(type, membername, lhead)
static void dlist_delete_thoroughly(dlist_node *node)
static void dlist_delete(dlist_node *node)
static dlist_node * dlist_pop_head_node(dlist_head *head)
#define dlist_foreach_modify(iter, lhead)
static bool dlist_is_empty(const dlist_head *head)
static void dlist_push_tail(dlist_head *head, dlist_node *node)
static void dlist_node_init(dlist_node *node)
#define dlist_container(type, membername, ptr)
#define IsParallelWorker()
static OffsetNumber ItemPointerGetOffsetNumber(const ItemPointerData *pointer)
static BlockNumber ItemPointerGetBlockNumber(const ItemPointerData *pointer)
Assert(fmt[strlen(fmt) - 1] !='\n')
#define SetInvalidVirtualTransactionId(vxid)
#define GET_VXID_FROM_PGPROC(vxid, proc)
bool LWLockHeldByMe(LWLock *lock)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
bool LWLockHeldByMeInMode(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
void LWLockInitialize(LWLock *lock, int tranche_id)
@ LWTRANCHE_SERIAL_BUFFER
@ LWTRANCHE_PER_XACT_PREDICATE_LIST
#define NUM_PREDICATELOCK_PARTITIONS
static bool pg_lfind32(uint32 key, uint32 *base, uint32 nelem)
#define ERRCODE_T_R_SERIALIZATION_FAILURE
void CheckPointPredicate(void)
void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno)
static void DecrementParentLocks(const PREDICATELOCKTARGETTAG *targettag)
static HTAB * PredicateLockHash
static void SetPossibleUnsafeConflict(SERIALIZABLEXACT *roXact, SERIALIZABLEXACT *activeXact)
#define PredicateLockTargetTagHashCode(predicatelocktargettag)
static void SetNewSxactGlobalXmin(void)
void PredicateLockTwoPhaseFinish(TransactionId xid, bool isCommit)
PredicateLockData * GetPredicateLockStatusData(void)
void InitPredicateLocks(void)
static void ReleasePredXact(SERIALIZABLEXACT *sxact)
void SetSerializableTransactionSnapshot(Snapshot snapshot, VirtualTransactionId *sourcevxid, int sourcepid)
static bool RWConflictExists(const SERIALIZABLEXACT *reader, const SERIALIZABLEXACT *writer)
static bool PredicateLockingNeededForRelation(Relation relation)
static bool SerializationNeededForRead(Relation relation, Snapshot snapshot)
static Snapshot GetSafeSnapshot(Snapshot origSnapshot)
#define SxactIsCommitted(sxact)
static SerialControl serialControl
void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot)
#define SxactIsROUnsafe(sxact)
static Snapshot GetSerializableTransactionSnapshotInt(Snapshot snapshot, VirtualTransactionId *sourcevxid, int sourcepid)
static LWLock * ScratchPartitionLock
static void PredicateLockAcquire(const PREDICATELOCKTARGETTAG *targettag)
#define SxactIsDeferrableWaiting(sxact)
static void ReleasePredicateLocksLocal(void)
static HTAB * LocalPredicateLockHash
int max_predicate_locks_per_page
struct SerialControlData * SerialControl
static PredXactList PredXact
static void SetRWConflict(SERIALIZABLEXACT *reader, SERIALIZABLEXACT *writer)
int GetSafeSnapshotBlockingPids(int blocked_pid, int *output, int output_size)
static uint32 ScratchTargetTagHash
static void RemoveTargetIfNoLongerUsed(PREDICATELOCKTARGET *target, uint32 targettaghash)
static uint32 predicatelock_hash(const void *key, Size keysize)
void CheckForSerializableConflictOut(Relation relation, TransactionId xid, Snapshot snapshot)
#define SxactIsReadOnly(sxact)
#define SerialNextPage(page)
static void DropAllPredicateLocksFromTable(Relation relation, bool transfer)
bool PageIsPredicateLocked(Relation relation, BlockNumber blkno)
static SlruCtlData SerialSlruCtlData
static void CreatePredicateLock(const PREDICATELOCKTARGETTAG *targettag, uint32 targettaghash, SERIALIZABLEXACT *sxact)
static void SerialAdd(TransactionId xid, SerCommitSeqNo minConflictCommitSeqNo)
static void ClearOldPredicateLocks(void)
#define SxactHasSummaryConflictIn(sxact)
static SERIALIZABLEXACT * CreatePredXact(void)
static bool GetParentPredicateLockTag(const PREDICATELOCKTARGETTAG *tag, PREDICATELOCKTARGETTAG *parent)
#define PredicateLockHashCodeFromTargetHashCode(predicatelocktag, targethash)
static void RestoreScratchTarget(bool lockheld)
#define SerialValue(slotno, xid)
static void DeleteChildTargetLocks(const PREDICATELOCKTARGETTAG *newtargettag)
static void DeleteLockTarget(PREDICATELOCKTARGET *target, uint32 targettaghash)
static SERIALIZABLEXACT * OldCommittedSxact
#define SxactHasConflictOut(sxact)
void CheckForSerializableConflictIn(Relation relation, ItemPointer tid, BlockNumber blkno)
static bool MyXactDidWrite
static int MaxPredicateChildLocks(const PREDICATELOCKTARGETTAG *tag)
static void FlagSxactUnsafe(SERIALIZABLEXACT *sxact)
static void SerialInit(void)
void CheckTableForSerializableConflictIn(Relation relation)
#define SxactIsPrepared(sxact)
void PredicateLockTID(Relation relation, ItemPointer tid, Snapshot snapshot, TransactionId tuple_xid)
void AttachSerializableXact(SerializableXactHandle handle)
struct SerialControlData SerialControlData
SerializableXactHandle ShareSerializableXact(void)
static bool PredicateLockExists(const PREDICATELOCKTARGETTAG *targettag)
static void RemoveScratchTarget(bool lockheld)
#define SxactIsOnFinishedList(sxact)
#define SxactIsPartiallyReleased(sxact)
static void SerialSetActiveSerXmin(TransactionId xid)
static dlist_head * FinishedSerializableTransactions
static bool SerializationNeededForWrite(Relation relation)
static HTAB * SerializableXidHash
static bool CheckAndPromotePredicateLockRequest(const PREDICATELOCKTARGETTAG *reqtag)
void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno)
static void CheckTargetForConflictsIn(PREDICATELOCKTARGETTAG *targettag)
int max_predicate_locks_per_relation
#define SxactIsROSafe(sxact)
void PreCommit_CheckForSerializationFailure(void)
void ReleasePredicateLocks(bool isCommit, bool isReadOnlySafe)
static void FlagRWConflict(SERIALIZABLEXACT *reader, SERIALIZABLEXACT *writer)
static const PREDICATELOCKTARGETTAG ScratchTargetTag
#define PredicateLockHashPartitionLockByIndex(i)
static void OnConflict_CheckForSerializationFailure(const SERIALIZABLEXACT *reader, SERIALIZABLEXACT *writer)
static bool SerialPagePrecedesLogically(int page1, int page2)
static bool CoarserLockCovers(const PREDICATELOCKTARGETTAG *newtargettag)
void PredicateLockRelation(Relation relation, Snapshot snapshot)
static SERIALIZABLEXACT * MySerializableXact
void predicatelock_twophase_recover(TransactionId xid, uint16 info, void *recdata, uint32 len)
Size PredicateLockShmemSize(void)
#define SxactIsDoomed(sxact)
#define NPREDICATELOCKTARGETENTS()
static SerCommitSeqNo SerialGetMinConflictCommitSeqNo(TransactionId xid)
static void SummarizeOldestCommittedSxact(void)
#define TargetTagIsCoveredBy(covered_target, covering_target)
static RWConflictPoolHeader RWConflictPool
static void ReleaseRWConflict(RWConflict conflict)
static bool TransferPredicateLocksToNewTarget(PREDICATELOCKTARGETTAG oldtargettag, PREDICATELOCKTARGETTAG newtargettag, bool removeOld)
void AtPrepare_PredicateLocks(void)
void RegisterPredicateLockingXid(TransactionId xid)
#define PredicateLockHashPartitionLock(hashcode)
#define SERIAL_ENTRIESPERPAGE
static bool XidIsConcurrent(TransactionId xid)
static void ReleaseOneSerializableXact(SERIALIZABLEXACT *sxact, bool partial, bool summarize)
static HTAB * PredicateLockTargetHash
bool CheckForSerializableConflictOutNeeded(Relation relation, Snapshot snapshot)
#define SxactIsRolledBack(sxact)
static SERIALIZABLEXACT * SavedSerializableXact
#define SxactHasSummaryConflictOut(sxact)
void TransferPredicateLocksToHeapRelation(Relation relation)
void PostPrepare_PredicateLocks(TransactionId xid)
static void CreateLocalPredicateLockHash(void)
int max_predicate_locks_per_xact
Snapshot GetSerializableTransactionSnapshot(Snapshot snapshot)
void * SerializableXactHandle
#define NUM_SERIAL_BUFFERS
#define RWConflictDataSize
#define SXACT_FLAG_DEFERRABLE_WAITING
#define SXACT_FLAG_SUMMARY_CONFLICT_IN
@ TWOPHASEPREDICATERECORD_XACT
@ TWOPHASEPREDICATERECORD_LOCK
#define FirstNormalSerCommitSeqNo
#define InvalidSerCommitSeqNo
struct PREDICATELOCKTAG PREDICATELOCKTAG
#define SXACT_FLAG_CONFLICT_OUT
#define PredXactListDataSize
#define SXACT_FLAG_READ_ONLY
#define SXACT_FLAG_DOOMED
struct LOCALPREDICATELOCK LOCALPREDICATELOCK
#define GET_PREDICATELOCKTARGETTAG_DB(locktag)
#define GET_PREDICATELOCKTARGETTAG_RELATION(locktag)
#define RWConflictPoolHeaderDataSize
struct SERIALIZABLEXIDTAG SERIALIZABLEXIDTAG
#define InvalidSerializableXact
struct PREDICATELOCKTARGET PREDICATELOCKTARGET
#define SET_PREDICATELOCKTARGETTAG_PAGE(locktag, dboid, reloid, blocknum)
#define RecoverySerCommitSeqNo
struct PREDICATELOCKTARGETTAG PREDICATELOCKTARGETTAG
struct SERIALIZABLEXID SERIALIZABLEXID
#define GET_PREDICATELOCKTARGETTAG_TYPE(locktag)
#define SET_PREDICATELOCKTARGETTAG_RELATION(locktag, dboid, reloid)
#define SXACT_FLAG_ROLLED_BACK
#define SXACT_FLAG_COMMITTED
#define SXACT_FLAG_RO_UNSAFE
#define SXACT_FLAG_PREPARED
#define SET_PREDICATELOCKTARGETTAG_TUPLE(locktag, dboid, reloid, blocknum, offnum)
#define SXACT_FLAG_PARTIALLY_RELEASED
#define GET_PREDICATELOCKTARGETTAG_PAGE(locktag)
#define SXACT_FLAG_RO_SAFE
struct PREDICATELOCK PREDICATELOCK
#define SXACT_FLAG_SUMMARY_CONFLICT_OUT
#define GET_PREDICATELOCKTARGETTAG_OFFSET(locktag)
Snapshot GetSnapshotData(Snapshot snapshot)
bool ProcArrayInstallImportedXmin(TransactionId xmin, VirtualTransactionId *sourcevxid)
#define RelationUsesLocalBuffers(relation)
bool ShmemAddrIsValid(const void *addr)
void * ShmemAlloc(Size size)
Size add_size(Size s1, Size s2)
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
Size mul_size(Size s1, Size s2)
HTAB * ShmemInitHash(const char *name, long init_size, long max_size, HASHCTL *infoP, int hash_flags)
void SimpleLruWriteAll(SlruCtl ctl, bool allow_redirtied)
void SimpleLruInit(SlruCtl ctl, const char *name, int nslots, int nlsns, LWLock *ctllock, const char *subdir, int tranche_id, SyncRequestHandler sync_handler)
void SimpleLruTruncate(SlruCtl ctl, int cutoffPage)
int SimpleLruZeroPage(SlruCtl ctl, int pageno)
int SimpleLruReadPage_ReadOnly(SlruCtl ctl, int pageno, TransactionId xid)
int SimpleLruReadPage(SlruCtl ctl, int pageno, bool write_ok, TransactionId xid)
Size SimpleLruShmemSize(int nslots, int nlsns)
#define SlruPagePrecedesUnitTests(ctl, per_page)
#define SLRU_PAGES_PER_SEGMENT
Snapshot GetTransactionSnapshot(void)
#define IsMVCCSnapshot(snapshot)
void ProcSendSignal(int pgprocno)
void ProcWaitForSignal(uint32 wait_event_info)
SERIALIZABLEXACT * myXact
PREDICATELOCKTARGET * myTarget
PREDICATELOCKTARGETTAG tag
dlist_head predicateLocks
SerCommitSeqNo commitSeqNo
SERIALIZABLEXACT * element
SerCommitSeqNo LastSxactCommitSeqNo
SerCommitSeqNo CanPartialClearThrough
SERIALIZABLEXACT * OldCommittedSxact
SerCommitSeqNo HavePartialClearedThrough
TransactionId SxactGlobalXmin