Re: Standby accepts recovery_target_timeline setting?
Stephen Frost <sfrost@snowman.net>
From: Stephen Frost <sfrost@snowman.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Fujii Masao <masao.fujii@gmail.com>, Michael Paquier <michael@paquier.xyz>, David Steele <david@pgmasters.net>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2019-10-09T12:42:53Z
Lists: pgsql-hackers
Greetings, * Robert Haas (robertmhaas@gmail.com) wrote: > On Tue, Oct 8, 2019 at 9:58 AM Stephen Frost <sfrost@snowman.net> wrote: > > From a user > > perspective, what happens when you've started up PG as a primary, since > > you don't have a signal file in place to indicate that you're doing > > recovery, and you have a recovery_target set, so some user does > > "show recovery_target_name" and sees a value? How is that sensible? > > I'd argue that not only is it sensible, but it's the only correct > answer. If I put a value in postgresql.conf and it doesn't show up in > the output of SHOW, I'm going to be confused. That just seems flat > wrong to me. You're going to be really confused when you realize that, sure, it's set, but we just completely ignored it ... How about we look at things like listen_addresses or shared_buffers? Let's make a similar argument there- some day, in the future, we make PG automagically realize when shared_buffers is too high to be able to start up, so we lower it to some other value just to get the database online, with the hope that the user will realize and fix the setting (this isn't a joke- having shared_buffers be too high through an ALTER SYSTEM setting is a real problem and it'd be nice if we had a way to deal with that...), you think we should keep the shared_buffers variable showing whatever was in the config file because, well, that's what was in the config file? If anything, what we should be doing here is throwing a WARNING or similar that these settings don't make sense, because we aren't going through recovery, and blank them out. If we want to be really cute, we could have the show return something like: <not in recovery>, or similar, but just returning an invalid value because that's what was in the config file is nonsense. SHOW isn't a view of what's in postgresql.conf, it's telling the user what the current system state is. Thanks, Stephen
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