Re: pg_get_wal_replay_pause_state() should not return 'paused' while a promotion is ongoing.

Поиск
Список
Период
Сортировка
От Dilip Kumar
Тема Re: pg_get_wal_replay_pause_state() should not return 'paused' while a promotion is ongoing.
Дата
Msg-id CAFiTN-sOs-LnHkCaGsKMoc0CKhztJwzP4wGfn8_O21fFVspakg@mail.gmail.com
обсуждение исходный текст
Ответ на pg_get_wal_replay_pause_state() should not return 'paused' while a promotion is ongoing.  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Ответы Re: pg_get_wal_replay_pause_state() should not return 'paused' while a promotion is ongoing.  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Список pgsql-hackers
On Mon, May 17, 2021 at 7:59 PM Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
>
> If a promotion is triggered while recovery is paused, the paused state ends
> and promotion continues. But currently pg_get_wal_replay_pause_state()
> returns 'paused' in that case. Isn't this a bug?
>
> Attached patch fixes this issue by resetting the recovery pause state to
> 'not paused' when standby promotion is triggered.
>
> Thought?
>

I think, prior to commit 496ee647ecd2917369ffcf1eaa0b2cdca07c8730
(Prefer standby promotion over recovery pause.) this behavior was fine
because the pause was continued but after this commit now we are
giving preference to pause so this is a bug so need to be fixed.

The fix looks fine but I think along with this we should also return
immediately from the pause loop if promotion is requested.  Because if
we recheck the recovery pause then someone can pause again and we will
be in loop so better to exit as soon as promotion is requested, see
attached patch.  Should be applied along with your patch.

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: Testing autovacuum wraparound (including failsafe)
Следующее
От: vignesh C
Дата:
Сообщение: Re: subscriptioncheck failure