Обсуждение: Document recovery_target_action behavior?

Поиск
Список
Период
Сортировка

Document recovery_target_action behavior?

От
David Steele
Дата:
Hackers,

In versions < PG12 recovery_target_action has a behavior that appears to
be a bug, or is at least undocumented.  If hot_standby = off and
recovery_target_action is not specified then the cluster will promote
when the target is found rather than shutting down as the documentation
seems to indicate.  If recovery_target_action is explicitly set to pause
then the cluster will shutdown as expected.

In PG12 the shutdown occurs even when recovery_target_action is not
explicitly set.  This seems like good behavior and it matches the
documentation as I read it.

The question for the old versions: is this something that should be
fixed in the code or in the documentation?

My vote is to make this explicit in the documentation, since changing
the recovery behavior in old versions could lead to nasty surprises.

Regards,
-- 
-David
david@pgmasters.net



Re: Document recovery_target_action behavior?

От
Fujii Masao
Дата:
On Sat, Sep 28, 2019 at 2:52 AM David Steele <david@pgmasters.net> wrote:
>
> Hackers,
>
> In versions < PG12 recovery_target_action has a behavior that appears to
> be a bug, or is at least undocumented.  If hot_standby = off and
> recovery_target_action is not specified then the cluster will promote
> when the target is found rather than shutting down as the documentation
> seems to indicate.  If recovery_target_action is explicitly set to pause
> then the cluster will shutdown as expected.

Good catch!

> In PG12 the shutdown occurs even when recovery_target_action is not
> explicitly set.  This seems like good behavior and it matches the
> documentation as I read it.

Agreed.

> The question for the old versions: is this something that should be
> fixed in the code or in the documentation?
>
> My vote is to make this explicit in the documentation, since changing
> the recovery behavior in old versions could lead to nasty surprises.

+1 to update the documentation.

Regards,

-- 
Fujii Masao



Re: Document recovery_target_action behavior?

От
David Steele
Дата:
On 9/28/19 11:14 AM, Fujii Masao wrote:
> On Sat, Sep 28, 2019 at 2:52 AM David Steele <david@pgmasters.net> wrote:
> 
>> The question for the old versions: is this something that should be
>> fixed in the code or in the documentation?
>>
>> My vote is to make this explicit in the documentation, since changing
>> the recovery behavior in old versions could lead to nasty surprises.
> 
> +1 to update the documentation.

OK, I'll put that on my list for after GA.  This has been the behavior
since 9.1 so it hardly seems like an emergency.

The behavior change in 12 may be a surprise for users, though, perhaps
we should add something to the Streaming Replication and Recovery
changes section in the release notes?

Looping in Jonathan to see if he thinks that's a good idea.

Regards,
-- 
-David
david@pgmasters.net



Re: Document recovery_target_action behavior?

От
"Jonathan S. Katz"
Дата:
On 9/28/19 12:00 PM, David Steele wrote:
> On 9/28/19 11:14 AM, Fujii Masao wrote:
>> On Sat, Sep 28, 2019 at 2:52 AM David Steele <david@pgmasters.net> wrote:
>>
>>> The question for the old versions: is this something that should be
>>> fixed in the code or in the documentation?
>>>
>>> My vote is to make this explicit in the documentation, since changing
>>> the recovery behavior in old versions could lead to nasty surprises.
>>
>> +1 to update the documentation.

FYI, documentation to compare, PG11:

https://www.postgresql.org/docs/11/recovery-target-settings.html#RECOVERY-TARGET-ACTION

PG12:

https://www.postgresql.org/docs/12/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET

After reading through, yes, I agree that +1 we should modify the
documentation.

And +1 for not modifying the behavior in the supported PG < 12 versions,
that could certainly catch people by surprise.

>
> OK, I'll put that on my list for after GA.  This has been the behavior
> since 9.1 so it hardly seems like an emergency.
>
> The behavior change in 12 may be a surprise for users, though, perhaps
> we should add something to the Streaming Replication and Recovery
> changes section in the release notes?
>
> Looping in Jonathan to see if he thinks that's a good idea.

I would suggest we add a bullet to the "E.1.2 Migration to Version
12"[1] section as one could see this behavior change as being
"incompatible" with older versions. Moving aside the "recovery.conf"
file change, if you did not specify your "recovery_target_action" but
expect your instance to be available (albeit paused), you may be in for
a surprise, especially if you have things automated.

I don't know if I would put it in the "E.1.3.2" section though, but I
could be convinced either way.

Do you have some suggested wording? I could attempt to cobble together a
quick patch.

Thanks,

Jonathan

[1] https://www.postgresql.org/docs/12/release-12.html


Вложения