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

Commitfe546f3

Browse files
committed
Don't wait for the commit record to be replicated if we wrote no WAL.
When using synchronous replication, we waited for the commit record to bereplicated, but if we our transaction didn't write any other WAL records,that's not required because we don't even flush the WAL locally to disk inthat case. This lead to long waits when committing a transaction that onlymodified a temporary table. Bug spotted by Thom Brown.
1 parentcf714c8 commitfe546f3

File tree

1 file changed

+2
-1
lines changed
  • src/backend/access/transam

1 file changed

+2
-1
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,8 @@ RecordTransactionCommit(void)
11681168
* Note that at this stage we have marked clog, but still show as running
11691169
* in the procarray and continue to hold locks.
11701170
*/
1171-
SyncRepWaitForLSN(XactLastRecEnd);
1171+
if (wrote_xlog)
1172+
SyncRepWaitForLSN(XactLastRecEnd);
11721173

11731174
/* Reset XactLastRecEnd until the next transaction writes something */
11741175
XactLastRecEnd.xrecoff=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp