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: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <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:50:44
Message-ID: 1c177a61-e24e-461a-e046-eca80e9ee0fb@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/04/22 6:57, Alvaro Herrera wrote:
> On 2020-Apr-20, Fujii Masao wrote:
>
>> + /*
>> + * In 9.1 and 9.2 the postmaster unlinked the promote file inside the
>> + * signal handler. It now leaves the file in place and lets the
>> + * Startup process do the unlink.
>> + */
>> + if (IsPromoteSignaled() && stat(PROMOTE_SIGNAL_FILE, &stat_buf) == 0)
>> {
>> - /*
>> - * In 9.1 and 9.2 the postmaster unlinked the promote file inside the
>> - * signal handler. It now leaves the file in place and lets the
>> - * Startup process do the unlink. This allows Startup to know whether
>> - * it should create a full checkpoint before starting up (fallback
>> - * mode). Fast promotion takes precedence.
>> - */
>
> It seems pointless to leave a very old comment that documents what the
> code no longer does. I thikn it would be better to reword it indicating
> what the code does do, ie. something like "Leave the signal file in
> place; it will be removed by the startup process when ..."

Agreed. And, while reading the related code, I thought that it's more proper
to place this comment in CheckPromoteSignal() rather than
CheckForStandbyTrigger(). Because CheckPromoteSignal() actually does
what the comment says, i.e., leaves the promote signal file in place and
lets the startup process do the unlink.

Attached is the updated version of the patch.

Regards,

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

Attachment Content-Type Size
drop_non_fast_promotion_v2.patch text/plain 4.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-04-22 02:51:15 Re: Remove non-fast promotion Re: Should we remove a fallback promotion? take 2
Previous Message Tom Lane 2020-04-22 02:46:05 Re: Add "-Wimplicit-fallthrough" to default flags (was Re: pgsql: Support FETCH FIRST WITH TIES)