Re: replay pause vs. standby promotion

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Sergei Kornilov <sk(at)zsrv(dot)org>, Atsushi Torikoshi <atorik(at)gmail(dot)com>
Cc: Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: replay pause vs. standby promotion
Date: 2020-03-25 05:17:05
Message-ID: ee53a324-4f3c-1d81-a74e-b9983f518c4e@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/03/25 0:17, Sergei Kornilov wrote:
> Hello
>
>> I pushed the latest version of the patch. If you have further opinion
>> about immediate promotion, let's keep discussing that!
>
> Thank you!
>
> Honestly, I forgot that the promotion is documented in high-availability.sgml as:
>
>> Before failover, any WAL immediately available in the archive or in pg_wal will be
>> restored, but no attempt is made to connect to the master.
>
> I mistakenly thought that promote should be "immediately"...
>
>> If a promotion is triggered while recovery is paused, the paused state ends and a promotion continues.
>
> Could we add a few words in func.sgml to clarify the behavior? Especially for users from my example above. Something like:
>
>> If a promotion is triggered while recovery is paused, the paused state ends, replay of any WAL immediately available in the archive or in pg_wal will be continued and then a promotion will be completed.

This description is true if pause is requested by pg_wal_replay_pause(),
but not if recovery target is reached and pause is requested by
recovery_target_action=pause. In the latter case, even if there are WAL data
avaiable in pg_wal or archive, they are not replayed, i.e., the promotion
completes immediately. Probably we should document those two cases
explicitly to avoid the confusion about a promotion and recovery pause?

Regards,

--
Fujii Masao
NTT DATA CORPORATION
Advanced Platform Technology Group
Research and Development Headquarters

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-03-25 05:27:56 Re: Missing errcode() in ereport
Previous Message Masahiko Sawada 2020-03-25 05:16:35 Re: error context for vacuum to include block number