#include "storage/lock.h"
Go to the source code of this file.
#define FirstNormalSerCommitSeqNo ((SerCommitSeqNo) 2) |
Definition at line 38 of file predicate_internals.h.
Referenced by InitPredicateLocks().
#define GET_PREDICATELOCKTARGETTAG_DB | ( | locktag | ) | ((Oid) (locktag).locktag_field1) |
Definition at line 418 of file predicate_internals.h.
Referenced by CheckTableForSerializableConflictIn(), DropAllPredicateLocksFromTable(), GetParentPredicateLockTag(), and pg_lock_status().
#define GET_PREDICATELOCKTARGETTAG_OFFSET | ( | locktag | ) | ((OffsetNumber) (locktag).locktag_field4) |
Definition at line 424 of file predicate_internals.h.
Referenced by CheckTargetForConflictsIn(), and pg_lock_status().
#define GET_PREDICATELOCKTARGETTAG_PAGE | ( | locktag | ) | ((BlockNumber) (locktag).locktag_field3) |
Definition at line 422 of file predicate_internals.h.
Referenced by GetParentPredicateLockTag(), and pg_lock_status().
#define GET_PREDICATELOCKTARGETTAG_RELATION | ( | locktag | ) | ((Oid) (locktag).locktag_field2) |
Definition at line 420 of file predicate_internals.h.
Referenced by CheckTableForSerializableConflictIn(), DropAllPredicateLocksFromTable(), GetParentPredicateLockTag(), and pg_lock_status().
#define GET_PREDICATELOCKTARGETTAG_TYPE | ( | locktag | ) |
(((locktag).locktag_field4 != InvalidOffsetNumber) ? PREDLOCKTAG_TUPLE : \ (((locktag).locktag_field3 != InvalidBlockNumber) ? PREDLOCKTAG_PAGE : \ PREDLOCKTAG_RELATION))
Definition at line 428 of file predicate_internals.h.
Referenced by DropAllPredicateLocksFromTable(), GetParentPredicateLockTag(), pg_lock_status(), PredicateLockAcquire(), and PredicateLockPromotionThreshold().
#define GET_PREDICATELOCKTARGETTAG_XMIN | ( | locktag | ) | ((TransactionId) (locktag).locktag_field5) |
Definition at line 426 of file predicate_internals.h.
#define InvalidSerCommitSeqNo ((SerCommitSeqNo) UINT64CONST(0xFFFFFFFFFFFFFFFF)) |
Definition at line 36 of file predicate_internals.h.
Referenced by CheckForSerializableConflictOut(), ClearOldPredicateLocks(), DropAllPredicateLocksFromTable(), ReleaseOneSerializableXact(), SummarizeOldestCommittedSxact(), and TransferPredicateLocksToNewTarget().
#define InvalidSerializableXact ((SERIALIZABLEXACT *) NULL) |
Definition at line 480 of file predicate_internals.h.
Referenced by AtPrepare_PredicateLocks(), CheckTargetForConflictsIn(), GetSafeSnapshot(), GetSerializableTransactionSnapshotInt(), PostPrepare_PredicateLocks(), PreCommit_CheckForSerializationFailure(), predicatelock_twophase_recover(), RegisterPredicateLockingXid(), ReleasePredicateLocks(), SerializationNeededForRead(), and SerializationNeededForWrite().
#define PredXactListDataSize ((Size)MAXALIGN(sizeof(PredXactListData))) |
Definition at line 181 of file predicate_internals.h.
Referenced by InitPredicateLocks(), and PredicateLockShmemSize().
#define PredXactListElementDataSize ((Size)MAXALIGN(sizeof(PredXactListElementData))) |
Definition at line 142 of file predicate_internals.h.
Referenced by InitPredicateLocks(), and PredicateLockShmemSize().
#define RecoverySerCommitSeqNo ((SerCommitSeqNo) 1) |
Definition at line 37 of file predicate_internals.h.
#define RWConflictDataSize ((Size)MAXALIGN(sizeof(RWConflictData))) |
Definition at line 205 of file predicate_internals.h.
Referenced by InitPredicateLocks(), and PredicateLockShmemSize().
#define RWConflictPoolHeaderDataSize ((Size)MAXALIGN(sizeof(RWConflictPoolHeaderData))) |
Definition at line 216 of file predicate_internals.h.
Referenced by InitPredicateLocks(), and PredicateLockShmemSize().
#define SET_PREDICATELOCKTARGETTAG_PAGE | ( | locktag, | ||
dboid, | ||||
reloid, | ||||
blocknum | ||||
) |
((locktag).locktag_field1 = (dboid), \ (locktag).locktag_field2 = (reloid), \ (locktag).locktag_field3 = (blocknum), \ (locktag).locktag_field4 = InvalidOffsetNumber, \ (locktag).locktag_field5 = InvalidTransactionId)
Definition at line 404 of file predicate_internals.h.
Referenced by CheckForSerializableConflictIn(), GetParentPredicateLockTag(), PageIsPredicateLocked(), PredicateLockPage(), and PredicateLockPageSplit().
#define SET_PREDICATELOCKTARGETTAG_RELATION | ( | locktag, | ||
dboid, | ||||
reloid | ||||
) |
((locktag).locktag_field1 = (dboid), \ (locktag).locktag_field2 = (reloid), \ (locktag).locktag_field3 = InvalidBlockNumber, \ (locktag).locktag_field4 = InvalidOffsetNumber, \ (locktag).locktag_field5 = InvalidTransactionId)
Definition at line 397 of file predicate_internals.h.
Referenced by CheckForSerializableConflictIn(), DropAllPredicateLocksFromTable(), GetParentPredicateLockTag(), PredicateLockRelation(), and PredicateLockTuple().
#define SET_PREDICATELOCKTARGETTAG_TUPLE | ( | locktag, | ||
dboid, | ||||
reloid, | ||||
blocknum, | ||||
offnum, | ||||
xmin | ||||
) |
((locktag).locktag_field1 = (dboid), \ (locktag).locktag_field2 = (reloid), \ (locktag).locktag_field3 = (blocknum), \ (locktag).locktag_field4 = (offnum), \ (locktag).locktag_field5 = (xmin))
Definition at line 411 of file predicate_internals.h.
Referenced by CheckForSerializableConflictIn(), and PredicateLockTuple().
#define SXACT_FLAG_COMMITTED 0x00000001 |
Definition at line 110 of file predicate_internals.h.
#define SXACT_FLAG_CONFLICT_OUT 0x00000010 |
Definition at line 119 of file predicate_internals.h.
Referenced by ReleasePredicateLocks().
#define SXACT_FLAG_DEFERRABLE_WAITING 0x00000040 |
Definition at line 121 of file predicate_internals.h.
#define SXACT_FLAG_DOOMED 0x00000008 |
Definition at line 113 of file predicate_internals.h.
#define SXACT_FLAG_PREPARED 0x00000002 |
Definition at line 111 of file predicate_internals.h.
#define SXACT_FLAG_READ_ONLY 0x00000020 |
Definition at line 120 of file predicate_internals.h.
#define SXACT_FLAG_RO_SAFE 0x00000080 |
Definition at line 122 of file predicate_internals.h.
#define SXACT_FLAG_RO_UNSAFE 0x00000100 |
Definition at line 123 of file predicate_internals.h.
#define SXACT_FLAG_ROLLED_BACK 0x00000004 |
Definition at line 112 of file predicate_internals.h.
#define SXACT_FLAG_SUMMARY_CONFLICT_IN 0x00000200 |
Definition at line 124 of file predicate_internals.h.
#define SXACT_FLAG_SUMMARY_CONFLICT_OUT 0x00000400 |
Definition at line 125 of file predicate_internals.h.
typedef struct LOCALPREDICATELOCK LOCALPREDICATELOCK |
typedef struct PREDICATELOCK PREDICATELOCK |
typedef struct PredicateLockData PredicateLockData |
typedef struct PREDICATELOCKTAG PREDICATELOCKTAG |
typedef struct PREDICATELOCKTARGET PREDICATELOCKTARGET |
typedef struct PREDICATELOCKTARGETTAG PREDICATELOCKTARGETTAG |
typedef enum PredicateLockTargetType PredicateLockTargetType |
typedef struct PredXactListData* PredXactList |
Definition at line 179 of file predicate_internals.h.
typedef struct PredXactListData PredXactListData |
typedef struct PredXactListElementData* PredXactListElement |
Definition at line 140 of file predicate_internals.h.
typedef struct PredXactListElementData PredXactListElementData |
typedef struct RWConflictData* RWConflict |
Definition at line 203 of file predicate_internals.h.
typedef struct RWConflictData RWConflictData |
typedef struct RWConflictPoolHeaderData* RWConflictPoolHeader |
Definition at line 214 of file predicate_internals.h.
typedef struct RWConflictPoolHeaderData RWConflictPoolHeaderData |
typedef uint64 SerCommitSeqNo |
Definition at line 22 of file predicate_internals.h.
typedef struct SERIALIZABLEXACT SERIALIZABLEXACT |
typedef struct SERIALIZABLEXID SERIALIZABLEXID |
typedef struct SERIALIZABLEXIDTAG SERIALIZABLEXIDTAG |
typedef struct TwoPhasePredicateLockRecord TwoPhasePredicateLockRecord |
typedef struct TwoPhasePredicateRecord TwoPhasePredicateRecord |
typedef enum TwoPhasePredicateRecordType TwoPhasePredicateRecordType |
typedef struct TwoPhasePredicateXactRecord TwoPhasePredicateXactRecord |
Definition at line 370 of file predicate_internals.h.
{ PREDLOCKTAG_RELATION, PREDLOCKTAG_PAGE, PREDLOCKTAG_TUPLE /* TODO SSI: Other types may be needed for index locking */ } PredicateLockTargetType;
Definition at line 438 of file predicate_internals.h.
{ TWOPHASEPREDICATERECORD_XACT, TWOPHASEPREDICATERECORD_LOCK } TwoPhasePredicateRecordType;
PredicateLockData* GetPredicateLockStatusData | ( | void | ) |
Definition at line 1385 of file predicate.c.
References Assert, FirstPredicateLockMgrLock, hash_get_num_entries(), hash_seq_init(), hash_seq_search(), i, PredicateLockData::locktags, LW_SHARED, LWLockAcquire(), LWLockRelease(), PREDICATELOCKTAG::myTarget, PREDICATELOCKTAG::myXact, PredicateLockData::nelements, palloc(), SerializableXactHashLock, PREDICATELOCKTARGET::tag, PREDICATELOCK::tag, and PredicateLockData::xacts.
Referenced by pg_lock_status().
{ PredicateLockData *data; int i; int els, el; HASH_SEQ_STATUS seqstat; PREDICATELOCK *predlock; data = (PredicateLockData *) palloc(sizeof(PredicateLockData)); /* * To ensure consistency, take simultaneous locks on all partition locks * in ascending order, then SerializableXactHashLock. */ for (i = 0; i < NUM_PREDICATELOCK_PARTITIONS; i++) LWLockAcquire(FirstPredicateLockMgrLock + i, LW_SHARED); LWLockAcquire(SerializableXactHashLock, LW_SHARED); /* Get number of locks and allocate appropriately-sized arrays. */ els = hash_get_num_entries(PredicateLockHash); data->nelements = els; data->locktags = (PREDICATELOCKTARGETTAG *) palloc(sizeof(PREDICATELOCKTARGETTAG) * els); data->xacts = (SERIALIZABLEXACT *) palloc(sizeof(SERIALIZABLEXACT) * els); /* Scan through PredicateLockHash and copy contents */ hash_seq_init(&seqstat, PredicateLockHash); el = 0; while ((predlock = (PREDICATELOCK *) hash_seq_search(&seqstat))) { data->locktags[el] = predlock->tag.myTarget->tag; data->xacts[el] = *predlock->tag.myXact; el++; } Assert(el == els); /* Release locks in reverse order */ LWLockRelease(SerializableXactHashLock); for (i = NUM_PREDICATELOCK_PARTITIONS - 1; i >= 0; i--) LWLockRelease(FirstPredicateLockMgrLock + i); return data; }