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

Commit10fcfad

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 parent7985398 commit10fcfad

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
@@ -1141,7 +1141,8 @@ RecordTransactionCommit(void)
11411141
* Note that at this stage we have marked clog, but still show as running
11421142
* in the procarray and continue to hold locks.
11431143
*/
1144-
SyncRepWaitForLSN(XactLastRecEnd);
1144+
if (wrote_xlog)
1145+
SyncRepWaitForLSN(XactLastRecEnd);
11451146

11461147
/* Reset XactLastRecEnd until the next transaction writes something */
11471148
XactLastRecEnd.xrecoff=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp