1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Remove dead forceSync parameter of XactLogCommitRecord().

The function has been reading global variable forceSyncCommit, mirroring
the intent of the caller that passed forceSync=forceSyncCommit.  The
other caller, RecordTransactionCommitPrepared(), passed false.  Since
COMMIT PREPARED can't share a transaction with any command, it certainly
doesn't share a transaction with a command that sets forceSyncCommit.

Reviewed by Michael Paquier.

Discussion: https://postgr.es/m/20200617032615.GC2916904@rfd.leadboat.com
This commit is contained in:
Noah Misch
2020-06-20 01:25:40 -07:00
parent 74b4d78e03
commit d28ab91e71
3 changed files with 7 additions and 5 deletions

View File

@ -2217,7 +2217,7 @@ RecordTransactionCommitPrepared(TransactionId xid,
recptr = XactLogCommitRecord(committs, recptr = XactLogCommitRecord(committs,
nchildren, children, nrels, rels, nchildren, children, nrels, rels,
ninvalmsgs, invalmsgs, ninvalmsgs, invalmsgs,
initfileinval, false, initfileinval,
MyXactFlags | XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK, MyXactFlags | XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK,
xid, gid); xid, gid);

View File

@ -1048,7 +1048,9 @@ CommandCounterIncrement(void)
* ForceSyncCommit * ForceSyncCommit
* *
* Interface routine to allow commands to force a synchronous commit of the * Interface routine to allow commands to force a synchronous commit of the
* current top-level transaction * current top-level transaction. Currently, two-phase commit does not
* persist and restore this variable. So long as all callers use
* PreventInTransactionBlock(), that omission has no consequences.
*/ */
void void
ForceSyncCommit(void) ForceSyncCommit(void)
@ -1315,7 +1317,7 @@ RecordTransactionCommit(void)
XactLogCommitRecord(xactStopTimestamp, XactLogCommitRecord(xactStopTimestamp,
nchildren, children, nrels, rels, nchildren, children, nrels, rels,
nmsgs, invalMessages, nmsgs, invalMessages,
RelcacheInitFileInval, forceSyncCommit, RelcacheInitFileInval,
MyXactFlags, MyXactFlags,
InvalidTransactionId, NULL /* plain commit */ ); InvalidTransactionId, NULL /* plain commit */ );
@ -5468,7 +5470,7 @@ XactLogCommitRecord(TimestampTz commit_time,
int nsubxacts, TransactionId *subxacts, int nsubxacts, TransactionId *subxacts,
int nrels, RelFileNode *rels, int nrels, RelFileNode *rels,
int nmsgs, SharedInvalidationMessage *msgs, int nmsgs, SharedInvalidationMessage *msgs,
bool relcacheInval, bool forceSync, bool relcacheInval,
int xactflags, TransactionId twophase_xid, int xactflags, TransactionId twophase_xid,
const char *twophase_gid) const char *twophase_gid)
{ {

View File

@ -434,7 +434,7 @@ extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
int nsubxacts, TransactionId *subxacts, int nsubxacts, TransactionId *subxacts,
int nrels, RelFileNode *rels, int nrels, RelFileNode *rels,
int nmsgs, SharedInvalidationMessage *msgs, int nmsgs, SharedInvalidationMessage *msgs,
bool relcacheInval, bool forceSync, bool relcacheInval,
int xactflags, int xactflags,
TransactionId twophase_xid, TransactionId twophase_xid,
const char *twophase_gid); const char *twophase_gid);