Re: Standby accepts recovery_target_timeline setting?
David Steele <david@pgmasters.net>
From: David Steele <david@pgmasters.net>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2019-09-28T17:49:29Z
Lists: pgsql-hackers
On 9/28/19 1:26 PM, Fujii Masao wrote: > On Sun, Sep 29, 2019 at 12:51 AM David Steele <david@pgmasters.net> wrote: > > Yeah, more checks would be necessary. IMO easy fix is to forbid not only > recovery target parameters but also any recovery parameters (specified > in recovery.conf in previous versions) in crash recovery. > > In v11 or before, any parameters in recovery.conf cannot take effect in > crash recovery because crash recovery always starts without recovery.conf. > But in v12, those parameters are specified in postgresql.conf, > so they may take effect even in crash recovery (i.e., when both > recovery.signal and standby.signal are missing). This would be the root > cause of the problems that we are discussing, I think. > > There might be some recovery parameters that we can safely use > even in crash recovery, e.g., maybe recovery_end_command > (now, you can see that recovery_end_command is executed in > crash recovery in v12). But at this stage of v12, it's worth thinking to > just cause crash recovery to exit with an error when any recovery > parameter is set. Thought? I dislike the idea of crash recovery throwing fatal errors because there are recovery settings in postgresql.auto.conf. Since there is no defined mechanism for cleaning out old recovery settings we have to assume that they will persist (and accumulate) more or less forever. > Or if that change is overkill, alternatively we can make crash recovery > "ignore" any recovery parameters, e.g., by forcibly disabling > the parameters. I'd rather load recovery settings *only* if recovery.signal or standby.signal is present and do this only after crash recovery is complete, i.e. in the absence of backup_label. I think blindly loading recovery settings then trying to ignore them later is pretty much why we are having these issues in the first place. I'd rather not extend that pattern if possible. Regards, -- -David david@pgmasters.net
Commits
-
Make crash recovery ignore recovery_min_apply_delay setting.
- 03666dfa1817 12.1 landed
- 9b95a36be8be 13.0 landed
-
Make crash recovery ignore restore_command and recovery_end_command settings.
- fcf7f8d9242d 12.1 landed
- 20961ceaf042 13.0 landed
-
Make crash recovery ignore recovery target settings.
- 4af2ac3deeca 12.0 landed
- 7acf8a876b77 13.0 landed
-
doc: Further clarify how recovery target parameters are applied
- e04a53a6071d 13.0 landed
- a7e5ae53cbe7 12.0 landed
-
doc: Add timeline as valid recovery target in standby.signal documentation
- 775578a445bb 13.0 landed
- a37980d42824 12.0 landed