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

Commitf95f1ce

Browse files
committed
Ignore recovery_min_apply_delay until recovery has reached consistent state
Previously recovery_min_apply_delay was applied even before recoveryhad reached consistency. This could cause us to wait a long timeunexpectedly for read-only connections to be allowed. It's problematicbecause the standby was useless during that wait time.This patch changes recovery_min_apply_delay so that it's applied oncethe database has reached the consistent state. That is, even if the delayis set, the standby tries to replay WAL records as fast as possible untilit has reached consistency.Author: Michael PaquierReviewed-By: Julien RouhaudReported-By: Greg CloughBackpatch: 9.4, where recovery_min_apply_delay was addedBug: #13770Discussion:http://www.postgresql.org/message-id/20151111155006.2644.84564@wrigleys.postgresql.org
1 parent763b8f5 commitf95f1ce

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎doc/src/sgml/recovery-config.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
462462
are not visible until the corresponding commit record is applied.
463463
</para>
464464
<para>
465-
The delay occurs until the standby is promoted or triggered. After that
466-
the standby will end recovery without further waiting.
465+
The delay occurs once the database in recovery has reached a consistent
466+
state, until the standby is promoted or triggered. After that the standby
467+
will end recovery without further waiting.
467468
</para>
468469
<para>
469470
This parameter is intended for use with streaming replication deployments;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5672,6 +5672,10 @@ recoveryApplyDelay(XLogReaderState *record)
56725672
if (recovery_min_apply_delay <=0)
56735673
return false;
56745674

5675+
/* no delay is applied on a database not yet consistent */
5676+
if (!reachedConsistency)
5677+
return false;
5678+
56755679
/*
56765680
* Is it a COMMIT record?
56775681
*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp