Re: Remove non-fast promotion Re: Should we remove a fallback promotion? take 2

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: andres(at)anarazel(dot)de, alvherre(at)2ndquadrant(dot)com, michael(at)paquier(dot)xyz, robertmhaas(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Remove non-fast promotion Re: Should we remove a fallback promotion? take 2
Date: 2020-04-22 02:51:42
Message-ID: 558c7d13-a2e3-75e3-00e9-ed325e40be89@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/04/22 9:13, Kyotaro Horiguchi wrote:
> At Tue, 21 Apr 2020 22:08:56 +0900, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote in
>>
>>
>> On 2020/04/21 17:15, Kyotaro Horiguchi wrote:
>>> At Mon, 20 Apr 2020 15:26:16 +0900, Fujii Masao
>>> <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote in
>>>> Patch attached. I will add this into the first CF for v14.
>>> - if (!fast_promoted)
>>> + if (!promoted)
>>> RequestCheckpoint(CHECKPOINT_END_OF_RECOVERY |
>>> CHECKPOINT_IMMEDIATE |
>>> CHECKPOINT_WAIT);
>>> If we don't find the checkpoint record just before, we don't insert
>>> End-Of-Recovery record then run an immediate chekpoint. I think if we
>>> nuke the non-fast promotion, shouldn't we insert the EOR record even
>>> in that case?
>>
>> I'm not sure if that's safe. What if the server crashes before the
>> checkpoint
>> completes in that case? Since the last checkpoint record is not
>> available,
>> the subsequent crash recovery will fail. This would lead to that the
>> server
>> will never start up. Right? Currently ISTM that
>
> Yes, that's right.
>
>> end-of-recovery-checkpoint
>> is executed to avoid such trouble in that case.
>
> I meant that we always have EOR at the end of recovery. So in the
> missing latest checkpoint (and crash recovery) case, we insert EOR
> after the immediate checkpoint. That also means we no longer set
> CHECKPOINT_END_OF_RECOVERY to the checkpoint, too.

Could you tell me what the benefit by this change is? Even with this change,
the server still needs to wait for the checkpoint to complete before
becoming the master and starting the service, unlike fast promotion. No?

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-04-22 03:09:50 Re: Remove non-fast promotion Re: Should we remove a fallback promotion? take 2
Previous Message Fujii Masao 2020-04-22 02:51:15 Re: Remove non-fast promotion Re: Should we remove a fallback promotion? take 2