14 #ifndef PREDICATE_INTERNALS_H
15 #define PREDICATE_INTERNALS_H
38 #define InvalidSerCommitSeqNo ((SerCommitSeqNo) PG_UINT64_MAX)
39 #define RecoverySerCommitSeqNo ((SerCommitSeqNo) 1)
40 #define FirstNormalSerCommitSeqNo ((SerCommitSeqNo) 2)
121 #define SXACT_FLAG_COMMITTED 0x00000001
122 #define SXACT_FLAG_PREPARED 0x00000002
123 #define SXACT_FLAG_ROLLED_BACK 0x00000004
124 #define SXACT_FLAG_DOOMED 0x00000008
130 #define SXACT_FLAG_CONFLICT_OUT 0x00000010
131 #define SXACT_FLAG_READ_ONLY 0x00000020
132 #define SXACT_FLAG_DEFERRABLE_WAITING 0x00000040
133 #define SXACT_FLAG_RO_SAFE 0x00000080
134 #define SXACT_FLAG_RO_UNSAFE 0x00000100
135 #define SXACT_FLAG_SUMMARY_CONFLICT_IN 0x00000200
136 #define SXACT_FLAG_SUMMARY_CONFLICT_OUT 0x00000400
142 #define SXACT_FLAG_PARTIALLY_RELEASED 0x00000800
179 #define PredXactListDataSize \
180 ((Size)MAXALIGN(sizeof(PredXactListData)))
203 #define RWConflictDataSize \
204 ((Size)MAXALIGN(sizeof(RWConflictData)))
214 #define RWConflictPoolHeaderDataSize \
215 ((Size)MAXALIGN(sizeof(RWConflictPoolHeaderData)))
388 #define SET_PREDICATELOCKTARGETTAG_RELATION(locktag,dboid,reloid) \
389 ((locktag).locktag_field1 = (dboid), \
390 (locktag).locktag_field2 = (reloid), \
391 (locktag).locktag_field3 = InvalidBlockNumber, \
392 (locktag).locktag_field4 = InvalidOffsetNumber)
394 #define SET_PREDICATELOCKTARGETTAG_PAGE(locktag,dboid,reloid,blocknum) \
395 ((locktag).locktag_field1 = (dboid), \
396 (locktag).locktag_field2 = (reloid), \
397 (locktag).locktag_field3 = (blocknum), \
398 (locktag).locktag_field4 = InvalidOffsetNumber)
400 #define SET_PREDICATELOCKTARGETTAG_TUPLE(locktag,dboid,reloid,blocknum,offnum) \
401 ((locktag).locktag_field1 = (dboid), \
402 (locktag).locktag_field2 = (reloid), \
403 (locktag).locktag_field3 = (blocknum), \
404 (locktag).locktag_field4 = (offnum))
406 #define GET_PREDICATELOCKTARGETTAG_DB(locktag) \
407 ((Oid) (locktag).locktag_field1)
408 #define GET_PREDICATELOCKTARGETTAG_RELATION(locktag) \
409 ((Oid) (locktag).locktag_field2)
410 #define GET_PREDICATELOCKTARGETTAG_PAGE(locktag) \
411 ((BlockNumber) (locktag).locktag_field3)
412 #define GET_PREDICATELOCKTARGETTAG_OFFSET(locktag) \
413 ((OffsetNumber) (locktag).locktag_field4)
414 #define GET_PREDICATELOCKTARGETTAG_TYPE(locktag) \
415 (((locktag).locktag_field4 != InvalidOffsetNumber) ? PREDLOCKTAG_TUPLE : \
416 (((locktag).locktag_field3 != InvalidBlockNumber) ? PREDLOCKTAG_PAGE : \
417 PREDLOCKTAG_RELATION))
467 #define InvalidSerializableXact ((SERIALIZABLEXACT *) NULL)
476 int *
output,
int output_size);
struct RWConflictData RWConflictData
struct PredXactListData * PredXactList
struct TwoPhasePredicateRecord TwoPhasePredicateRecord
struct RWConflictPoolHeaderData RWConflictPoolHeaderData
PredicateLockData * GetPredicateLockStatusData(void)
struct SERIALIZABLEXACT SERIALIZABLEXACT
TwoPhasePredicateRecordType
@ TWOPHASEPREDICATERECORD_XACT
@ TWOPHASEPREDICATERECORD_LOCK
int GetSafeSnapshotBlockingPids(int blocked_pid, int *output, int output_size)
struct TwoPhasePredicateLockRecord TwoPhasePredicateLockRecord
struct PREDICATELOCKTAG PREDICATELOCKTAG
struct TwoPhasePredicateXactRecord TwoPhasePredicateXactRecord
struct LOCALPREDICATELOCK LOCALPREDICATELOCK
struct RWConflictPoolHeaderData * RWConflictPoolHeader
struct SERIALIZABLEXIDTAG SERIALIZABLEXIDTAG
struct PREDICATELOCKTARGET PREDICATELOCKTARGET
struct PREDICATELOCKTARGETTAG PREDICATELOCKTARGETTAG
struct SERIALIZABLEXID SERIALIZABLEXID
struct PredicateLockData PredicateLockData
struct RWConflictData * RWConflict
struct PredXactListData PredXactListData
struct PREDICATELOCK PREDICATELOCK
PREDICATELOCKTARGETTAG tag
SERIALIZABLEXACT * myXact
PREDICATELOCKTARGET * myTarget
PREDICATELOCKTARGETTAG tag
dlist_head predicateLocks
SerCommitSeqNo commitSeqNo
SERIALIZABLEXACT * element
SerCommitSeqNo LastSxactCommitSeqNo
SerCommitSeqNo CanPartialClearThrough
SERIALIZABLEXACT * OldCommittedSxact
SerCommitSeqNo HavePartialClearedThrough
TransactionId SxactGlobalXmin
PREDICATELOCKTARGETTAG * locktags
SERIALIZABLEXACT * sxactIn
SERIALIZABLEXACT * sxactOut
VirtualTransactionId vxid
LWLock perXactPredicateListLock
SerCommitSeqNo lastCommitBeforeSnapshot
union SERIALIZABLEXACT::@117 SeqNo
dlist_head possibleUnsafeConflicts
SerCommitSeqNo prepareSeqNo
dlist_head predicateLocks
SerCommitSeqNo commitSeqNo
TransactionId finishedBefore
SerCommitSeqNo earliestOutConflictCommit
SERIALIZABLEXACT * myXact
PREDICATELOCKTARGETTAG target
TwoPhasePredicateRecordType type
union TwoPhasePredicateRecord::@118 data
TwoPhasePredicateLockRecord lockRecord
TwoPhasePredicateXactRecord xactRecord