Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9b95a36

Browse files
committed
Make crash recovery ignore recovery_min_apply_delay setting.
In v11 or before, this setting could not take effect in crash recovery because it's specified in recovery.conf and crash recovery always starts without recovery.conf. But commit 2dedf4d integrated recovery.conf into postgresql.conf and which unexpectedly allowed this setting to take effect even in crash recovery. This is definitely not good behavior. To fix the issue, this commit makes crash recovery always ignore recovery_min_apply_delay setting. Back-patch to v12 where the issue was added. Author: Fujii Masao Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/CAHGQGwEyD6HdZLfdWc+95g=VQFPR4zQL4n+yHxQgGEGjaSVheQ@mail.gmail.com Discussion: https://postgr.es/m/e445616d-023e-a268-8aa1-67b8b335340c@pgmasters.net
1 parent 89403ed commit 9b95a36

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

doc/src/sgml/config.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4209,7 +4209,8 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
42094209
</para>
42104210
<para>
42114211
This parameter is intended for use with streaming replication deployments;
4212-
however, if the parameter is specified it will be honored in all cases.
4212+
however, if the parameter is specified it will be honored in all cases
4213+
except crash recovery.
42134214

42144215
<varname>hot_standby_feedback</varname> will be delayed by use of this feature
42154216
which could lead to bloat on the master; use both together with care.

src/backend/access/transam/xlog.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5977,6 +5977,10 @@ recoveryApplyDelay(XLogReaderState *record)
59775977
if (!reachedConsistency)
59785978
return false;
59795979

5980+
/* nothing to do if crash recovery is requested */
5981+
if (!ArchiveRecoveryRequested)
5982+
return false;
5983+
59805984
/*
59815985
* Is it a COMMIT record?
59825986
*

0 commit comments

Comments
 (0)