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

Commit2c8a4e9

Browse files
Wake WALSender to reduce data loss at failover for async commit.
WALSender now woken up after each background flush by WALwriter, avoidingmulti-second replication delay for an all-async commit workload.Replication delay reduced from 7s with default settings to 200ms and oftenmuch less, allowing significantly reduced data loss at failover.Andres Freund and Simon Riggs
1 parentb50991e commit2c8a4e9

File tree

1 file changed

+7
-0
lines changed
  • src/backend/access/transam

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,13 @@ XLogBackgroundFlush(void)
22712271

22722272
END_CRIT_SECTION();
22732273

2274+
/*
2275+
* If we wrote something then we have something to send to standbys also,
2276+
* otherwise the replication delay become around 7s with just async commit.
2277+
*/
2278+
if (wrote_something)
2279+
WalSndWakeup();
2280+
22742281
returnwrote_something;
22752282
}
22762283

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp