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

Commit65f4976

Browse files
committed
Add assertion check for WAL receiver state during stream-archive transition
When the startup process switches from streaming to archive as WALsource, we avoid calling ShutdownWalRcv() if the WAL receiver is notstreaming, based on WalRcvStreaming(). WALRCV_STOPPING is a state setby ShutdownWalRcv(), called only by the startup process, meaning that itshould not be possible to reach this state while inWaitForWALToBecomeAvailable().This commit adds an assertion to make sure that a WAL receiver is neverin a WALRCV_STOPPING state should the startup process attempt to resetInstallXLogFileSegmentActive.Idea suggested by Noah Misch.Author: Xuneng Zhou <xunengzhou@gmail.com>Discussion:https://postgr.es/m/19093-c4fff49a608f82a0@postgresql.org
1 parente0ca61e commit65f4976

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3698,6 +3698,14 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
36983698
XLogShutdownWalRcv();
36993699
else
37003700
{
3701+
/*
3702+
* WALRCV_STOPPING state is a transient state while
3703+
* the startup process is in ShutdownWalRcv(). It
3704+
* should never appear here since we would be waiting
3705+
* for the walreceiver to reach WALRCV_STOPPED in that
3706+
* case.
3707+
*/
3708+
Assert(WalRcvGetState()!=WALRCV_STOPPING);
37013709
ResetInstallXLogFileSegmentActive();
37023710
}
37033711

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp