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

Commitc455ee8

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 parent47698b4 commitc455ee8

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
@@ -6386,7 +6386,7 @@ StartupXLOG(void)
63866386
* Take ownership of the wakeup latch if we're going to sleep during
63876387
* recovery.
63886388
*/
6389-
if (StandbyModeRequested)
6389+
if (ArchiveRecoveryRequested)
63906390
OwnLatch(&XLogCtl->recoveryWakeupLatch);
63916391

63926392
/* Set up XLOG reader facility */
@@ -7390,7 +7390,7 @@ StartupXLOG(void)
73907390
* We don't need the latch anymore. It's not strictly necessary to disown
73917391
* it, but let's do it for the sake of tidiness.
73927392
*/
7393-
if (StandbyModeRequested)
7393+
if (ArchiveRecoveryRequested)
73947394
DisownLatch(&XLogCtl->recoveryWakeupLatch);
73957395

73967396
/*
@@ -11924,6 +11924,12 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
1192411924
* hope...
1192511925
*/
1192611926

11927+
/*
11928+
* We should be able to move to XLOG_FROM_STREAM
11929+
* only in standby mode.
11930+
*/
11931+
Assert(StandbyMode);
11932+
1192711933
/*
1192811934
* Before we leave XLOG_FROM_STREAM state, make sure that
1192911935
* walreceiver is not active, so that it won't overwrite
@@ -12035,6 +12041,12 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
1203512041
{
1203612042
boolhavedata;
1203712043

12044+
/*
12045+
* We should be able to move to XLOG_FROM_STREAM
12046+
* only in standby mode.
12047+
*/
12048+
Assert(StandbyMode);
12049+
1203812050
/*
1203912051
* Check if WAL receiver is still active.
1204012052
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp