diff options
author | Simon Riggs | 2012-12-03 13:13:53 +0000 |
---|---|---|
committer | Simon Riggs | 2012-12-03 13:13:53 +0000 |
commit | f21bb9cfb5646e1793dcc9c0ea697bab99afa523 (patch) | |
tree | 762c5554c78e8949f97dbb17f25b4fc16416600b /src/backend/access/transam/twophase.c | |
parent | 7a764990d8c07c5f8f6c7ff3e8605d482b6778e0 (diff) |
Refactor inCommit flag into generic delayChkpt flag.
Rename PGXACT->inCommit flag into delayChkpt flag,
and generalise comments to allow use in other situations,
such as the forthcoming potential use in checksum patch.
Replace wait loop to look for VXIDs with delayChkpt set.
No user visible changes, not behaviour changes at present.
Simon Riggs, reviewed and rebased by Jeff Davis
Diffstat (limited to 'src/backend/access/transam/twophase.c')
-rw-r--r-- | src/backend/access/transam/twophase.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c index 5139af69bbf..3a0b190abcf 100644 --- a/src/backend/access/transam/twophase.c +++ b/src/backend/access/transam/twophase.c @@ -318,7 +318,7 @@ MarkAsPreparing(TransactionId xid, const char *gid, proc->lxid = (LocalTransactionId) xid; pgxact->xid = xid; pgxact->xmin = InvalidTransactionId; - pgxact->inCommit = false; + pgxact->delayChkpt = false; pgxact->vacuumFlags = 0; proc->pid = 0; proc->backendId = InvalidBackendId; @@ -1034,18 +1034,18 @@ EndPrepare(GlobalTransaction gxact) * odds of a PANIC actually occurring should be very tiny given that we * were able to write the bogus CRC above. * - * We have to set inCommit here, too; otherwise a checkpoint starting + * We have to set delayChkpt here, too; otherwise a checkpoint starting * immediately after the WAL record is inserted could complete without * fsync'ing our state file. (This is essentially the same kind of race * condition as the COMMIT-to-clog-write case that RecordTransactionCommit - * uses inCommit for; see notes there.) + * uses delayChkpt for; see notes there.) * * We save the PREPARE record's location in the gxact for later use by * CheckPointTwoPhase. */ START_CRIT_SECTION(); - MyPgXact->inCommit = true; + MyPgXact->delayChkpt = true; gxact->prepare_lsn = XLogInsert(RM_XACT_ID, XLOG_XACT_PREPARE, records.head); @@ -1086,7 +1086,7 @@ EndPrepare(GlobalTransaction gxact) * checkpoint starting after this will certainly see the gxact as a * candidate for fsyncing. */ - MyPgXact->inCommit = false; + MyPgXact->delayChkpt = false; END_CRIT_SECTION(); @@ -1972,7 +1972,7 @@ RecoverPreparedTransactions(void) * RecordTransactionCommitPrepared * * This is basically the same as RecordTransactionCommit: in particular, - * we must set the inCommit flag to avoid a race condition. + * we must set the delayChkpt flag to avoid a race condition. * * We know the transaction made at least one XLOG entry (its PREPARE), * so it is never possible to optimize out the commit record. @@ -1995,7 +1995,7 @@ RecordTransactionCommitPrepared(TransactionId xid, START_CRIT_SECTION(); /* See notes in RecordTransactionCommit */ - MyPgXact->inCommit = true; + MyPgXact->delayChkpt = true; /* Emit the XLOG commit record */ xlrec.xid = xid; @@ -2053,7 +2053,7 @@ RecordTransactionCommitPrepared(TransactionId xid, TransactionIdCommitTree(xid, nchildren, children); /* Checkpoint can proceed now */ - MyPgXact->inCommit = false; + MyPgXact->delayChkpt = false; END_CRIT_SECTION(); |