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

Commitf7b7070

Browse files
committed
Fix failure of archive recovery with recovery_min_apply_delay enabled.
recovery_min_apply_delay parameter is intended for use with streamingreplication deployments. However, the document clearly explains thatthe parameter will be honored in all cases if it's specified. So it shouldtake effect even if in archive recovery. But, previously, archive recoverywith recovery_min_apply_delay enabled always failed, and caused assertionfailure if --enable-caasert is enabled.The cause of this problem is that; the ownership of recoveryWakeupLatchthat recovery_min_apply_delay uses was taken only when standby modeis requested. So unowned latch could be used in archive recovery, andwhich caused the failure.This commit changes recovery code so that the ownership ofrecoveryWakeupLatch is taken even in archive recovery. Which preventsarchive recovery with recovery_min_apply_delay from failing.Back-patch to v9.4 where recovery_min_apply_delay was added.Author: Fujii MasaoReviewed-by: Michael PaquierDiscussion:https://postgr.es/m/CAHGQGwEyD6HdZLfdWc+95g=VQFPR4zQL4n+yHxQgGEGjaSVheQ@mail.gmail.com
1 parentfeed5ee commitf7b7070

File tree

1 file changed

+14
-2
lines changed
  • src/backend/access/transam

1 file changed

+14
-2
lines changed

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6458,7 +6458,7 @@ StartupXLOG(void)
64586458
* Take ownership of the wakeup latch if we're going to sleep during
64596459
* recovery.
64606460
*/
6461-
if (StandbyModeRequested)
6461+
if (ArchiveRecoveryRequested)
64626462
OwnLatch(&XLogCtl->recoveryWakeupLatch);
64636463

64646464
/* Set up XLOG reader facility */
@@ -7445,7 +7445,7 @@ StartupXLOG(void)
74457445
* We don't need the latch anymore. It's not strictly necessary to disown
74467446
* it, but let's do it for the sake of tidiness.
74477447
*/
7448-
if (StandbyModeRequested)
7448+
if (ArchiveRecoveryRequested)
74497449
DisownLatch(&XLogCtl->recoveryWakeupLatch);
74507450

74517451
/*
@@ -12006,6 +12006,12 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
1200612006
* hope...
1200712007
*/
1200812008

12009+
/*
12010+
* We should be able to move to XLOG_FROM_STREAM
12011+
* only in standby mode.
12012+
*/
12013+
Assert(StandbyMode);
12014+
1200912015
/*
1201012016
* Before we leave XLOG_FROM_STREAM state, make sure that
1201112017
* walreceiver is not active, so that it won't overwrite
@@ -12117,6 +12123,12 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
1211712123
{
1211812124
boolhavedata;
1211912125

12126+
/*
12127+
* We should be able to move to XLOG_FROM_STREAM
12128+
* only in standby mode.
12129+
*/
12130+
Assert(StandbyMode);
12131+
1212012132
/*
1212112133
* Check if WAL receiver is still active.
1212212134
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp