/* these values are not both interesting at the same time */ union
{
SerCommitSeqNo earliestOutConflictCommit; /* when committed with
* conflict out */
SerCommitSeqNo lastCommitBeforeSnapshot; /* when not committed or
* no conflict out */
} SeqNo;
dlist_head outConflicts; /* list of write transactions whose data we
* couldn't read. */
dlist_head inConflicts; /* list of read transactions which couldn't
* see our write. */
dlist_head predicateLocks; /* list of associated PREDICATELOCK objects */
dlist_node finishedLink; /* list link in
* FinishedSerializableTransactions */
dlist_node xactLink; /* PredXact->activeList/availableList */
TransactionId topXid; /* top level xid for the transaction, if one
* exists; else invalid */
TransactionId finishedBefore; /* invalid means still running; else the *structexpireswhennoserializable
* xids are before this. */
TransactionId xmin; /* the transaction's snapshot xmin */
uint32 flags; /* OR'd combination of values defined below */ int pid; /* pid of associated process */ int pgprocno; /* pgprocno of associated process */
} SERIALIZABLEXACT;
/* *Theseglobalvariablesaremaintainedwhenregisteringandcleaningup *serializabletransactions.Theymustbeglobalacrossallbackends, *butarenotneededoutsidethepredicate.csourcefile.Protectedby *SerializableXactHashLock.
*/
TransactionId SxactGlobalXmin; /* global xmin for active serializable
* transactions */ int SxactGlobalXminCount; /* how many active serializable
* transactions have this xmin */ int WritableSxactCount; /* how many non-read-only serializable
* transactions are active */
SerCommitSeqNo LastSxactCommitSeqNo; /* a strictly monotonically *increasingnumberforcommits
* of serializable transactions */ /* Protected by SerializableXactHashLock. */
SerCommitSeqNo CanPartialClearThrough; /* can clear predicate locks and *inConflictsforcommitted *transactionsthroughthisseq
* no */ /* Protected by SerializableFinishedListLock. */
SerCommitSeqNo HavePartialClearedThrough; /* have cleared through this
* seq no */
SERIALIZABLEXACT *OldCommittedSxact; /* shared copy of dummy sxact */
/* *Thefollowingtypesareusedtoprovidelistsofrw-conflictsbetween *pairsoftransactions.Sinceexactlythesameinformationisneeded, *theyarealsousedtorecordpossibleunsafetransactionrelationships *forpurposesofidentifyingsafesnapshotsforread-onlytransactions. * *WhenaRWConflictDataisnotinusetorecordeithertypeofrelationship *betweenapairoftransactions,itiskeptonan"available"list.The *outLinkfieldisusedformaintainingthatlist.
*/ typedefstruct RWConflictData
{
dlist_node outLink; /* link for list of conflicts out from a sxact */
dlist_node inLink; /* link for list of conflicts in to a sxact */
SERIALIZABLEXACT *sxactOut;
SERIALIZABLEXACT *sxactIn;
} RWConflictData;
/* data */
SERIALIZABLEXACT *myXact; /* pointer to the top level transaction data */
} SERIALIZABLEXID;
/* *ThePREDICATELOCKTARGETTAGstructidentifiesadatabaseobjectwhichcan *bethetargetofpredicatelocks. * *Notethatthehashfunctionbeinguseddoesn'tproperlyrespecttag *length--ifthelengthofthestructureisn'tamultipleoffourbytesit *willgotoafourbyteboundarypasttheendofthetag.Ifyouchange *thisstruct,makesureanyslackspaceisinitialized,sothatanyrandom *bytesinthemiddleorattheendarenotincludedinthehash. * *TODOSSI:Ifwealwaysusethesamefieldsforthesametypeofvalue,we *shouldrenamethese.Holdingoffuntilit'scleartherearenoexceptions. *Sinceindexesarerelationswithblocksandtuples,it'slookinglikelythat *therenamewillbepossible.Ifnot,wemayneedtodividethelastfield *andusepartofitforatargettype,sothatweknowhowtointerpretthe *data..
*/ typedefstruct PREDICATELOCKTARGETTAG
{
uint32 locktag_field1; /* a 32-bit ID field */
uint32 locktag_field2; /* a 32-bit ID field */
uint32 locktag_field3; /* a 32-bit ID field */
uint32 locktag_field4; /* a 32-bit ID field */
} PREDICATELOCKTARGETTAG;
/* data */
dlist_node targetLink; /* list link in PREDICATELOCKTARGET's list of
* predicate locks */
dlist_node xactLink; /* list link in SERIALIZABLEXACT's list of
* predicate locks */
SerCommitSeqNo commitSeqNo; /* only used for summarized predicate locks */
} PREDICATELOCK;
/* data */ bool held; /* is lock held, or just its children? */ int childLocks; /* number of child locks currently held */
} LOCALPREDICATELOCK;
/* *Thetypesofpredicatelockswhichcanbeacquired.
*/ typedefenum PredicateLockTargetType
{
PREDLOCKTAG_RELATION,
PREDLOCKTAG_PAGE,
PREDLOCKTAG_TUPLE, /* TODO SSI: Other types may be needed for index locking */
} PredicateLockTargetType;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.