Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d28ab91

Browse files
committed
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
1 parent 74b4d78 commit d28ab91

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/backend/access/transam/twophase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2217,7 +2217,7 @@ RecordTransactionCommitPrepared(TransactionId xid,
22172217
recptr = XactLogCommitRecord(committs,
22182218
nchildren, children, nrels, rels,
22192219
ninvalmsgs, invalmsgs,
2220-
initfileinval, false,
2220+
initfileinval,
22212221
MyXactFlags | XACT_FLAGS_ACQUIREDACCESSEXCLUSIVELOCK,
22222222
xid, gid);
22232223

src/backend/access/transam/xact.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,9 @@ CommandCounterIncrement(void)
10481048
* ForceSyncCommit
10491049
*
10501050
* Interface routine to allow commands to force a synchronous commit of the
1051-
* current top-level transaction
1051+
* current top-level transaction. Currently, two-phase commit does not
1052+
* persist and restore this variable. So long as all callers use
1053+
* PreventInTransactionBlock(), that omission has no consequences.
10521054
*/
10531055
void
10541056
ForceSyncCommit(void)
@@ -1315,7 +1317,7 @@ RecordTransactionCommit(void)
13151317
XactLogCommitRecord(xactStopTimestamp,
13161318
nchildren, children, nrels, rels,
13171319
nmsgs, invalMessages,
1318-
RelcacheInitFileInval, forceSyncCommit,
1320+
RelcacheInitFileInval,
13191321
MyXactFlags,
13201322
InvalidTransactionId, NULL /* plain commit */ );
13211323

@@ -5468,7 +5470,7 @@ XactLogCommitRecord(TimestampTz commit_time,
54685470
int nsubxacts, TransactionId *subxacts,
54695471
int nrels, RelFileNode *rels,
54705472
int nmsgs, SharedInvalidationMessage *msgs,
5471-
bool relcacheInval, bool forceSync,
5473+
bool relcacheInval,
54725474
int xactflags, TransactionId twophase_xid,
54735475
const char *twophase_gid)
54745476
{

src/include/access/xact.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ extern XLogRecPtr XactLogCommitRecord(TimestampTz commit_time,
434434
int nsubxacts, TransactionId *subxacts,
435435
int nrels, RelFileNode *rels,
436436
int nmsgs, SharedInvalidationMessage *msgs,
437-
bool relcacheInval, bool forceSync,
437+
bool relcacheInval,
438438
int xactflags,
439439
TransactionId twophase_xid,
440440
const char *twophase_gid);

0 commit comments

Comments
 (0)