Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd28ab91

Browse files
committed
Remove dead forceSync parameter of XactLogCommitRecord().
The function has been reading global variable forceSyncCommit, mirroringthe intent of the caller that passed forceSync=forceSyncCommit. Theother caller, RecordTransactionCommitPrepared(), passed false. SinceCOMMIT PREPARED can't share a transaction with any command, it certainlydoesn'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 parent74b4d78 commitd28ab91

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
intnsubxacts,TransactionId*subxacts,
54695471
intnrels,RelFileNode*rels,
54705472
intnmsgs,SharedInvalidationMessage*msgs,
5471-
boolrelcacheInval,boolforceSync,
5473+
boolrelcacheInval,
54725474
intxactflags,TransactionIdtwophase_xid,
54735475
constchar*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
intnsubxacts,TransactionId*subxacts,
435435
intnrels,RelFileNode*rels,
436436
intnmsgs,SharedInvalidationMessage*msgs,
437-
boolrelcacheInval,boolforceSync,
437+
boolrelcacheInval,
438438
intxactflags,
439439
TransactionIdtwophase_xid,
440440
constchar*twophase_gid);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp