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

Commit1435a85

Browse files
committed
Before exiting walreceiver, fsync() all the WAL received.
Otherwise WAL recovery will replay the un-flushed WAL after walreceiver hasexited, which can lead to a non-recoverable standby if the system crashes hardat that point.
1 parenta08363d commit1435a85

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎src/backend/replication/walreceiver.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ WalRcvDie(int code, Datum arg)
323323
/* use volatile pointer to prevent code rearrangement */
324324
volatileWalRcvData*walrcv=WalRcv;
325325

326+
/* Ensure that all WAL records received are flushed to disk */
327+
XLogWalRcvFlush();
328+
326329
SpinLockAcquire(&walrcv->mutex);
327330
Assert(walrcv->walRcvState==WALRCV_RUNNING||
328331
walrcv->walRcvState==WALRCV_STOPPING);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp