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

Commitec1259e

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 parent9b95a36 commitec1259e

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
@@ -6354,7 +6354,7 @@ StartupXLOG(void)
63546354
* Take ownership of the wakeup latch if we're going to sleep during
63556355
* recovery.
63566356
*/
6357-
if (StandbyModeRequested)
6357+
if (ArchiveRecoveryRequested)
63586358
OwnLatch(&XLogCtl->recoveryWakeupLatch);
63596359

63606360
/* Set up XLOG reader facility */
@@ -7338,7 +7338,7 @@ StartupXLOG(void)
73387338
* We don't need the latch anymore. It's not strictly necessary to disown
73397339
* it, but let's do it for the sake of tidiness.
73407340
*/
7341-
if (StandbyModeRequested)
7341+
if (ArchiveRecoveryRequested)
73427342
DisownLatch(&XLogCtl->recoveryWakeupLatch);
73437343

73447344
/*
@@ -11873,6 +11873,12 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
1187311873
* hope...
1187411874
*/
1187511875

11876+
/*
11877+
* We should be able to move to XLOG_FROM_STREAM
11878+
* only in standby mode.
11879+
*/
11880+
Assert(StandbyMode);
11881+
1187611882
/*
1187711883
* Before we leave XLOG_FROM_STREAM state, make sure that
1187811884
* walreceiver is not active, so that it won't overwrite
@@ -11986,6 +11992,12 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
1198611992
{
1198711993
boolhavedata;
1198811994

11995+
/*
11996+
* We should be able to move to XLOG_FROM_STREAM
11997+
* only in standby mode.
11998+
*/
11999+
Assert(StandbyMode);
12000+
1198912001
/*
1199012002
* Check if WAL receiver is still active.
1199112003
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp