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

Commit34ef02b

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 parente0c2746 commit34ef02b

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
@@ -324,6 +324,9 @@ WalRcvDie(int code, Datum arg)
324324
/* use volatile pointer to prevent code rearrangement */
325325
volatileWalRcvData*walrcv=WalRcv;
326326

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp