Re: recovery_target_action=pause with confusing hint

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: "movead(dot)li(at)highgo(dot)ca" <movead(dot)li(at)highgo(dot)ca>, Sergei Kornilov <sk(at)zsrv(dot)org>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: recovery_target_action=pause with confusing hint
Date: 2020-04-01 10:37:15
Message-ID: 38196f9e-7094-d095-3e6d-89b32df33b0f@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/04/01 18:56, movead(dot)li(at)highgo(dot)ca wrote:
>
> >This happens because the startup process detects the trigger file
>>after pg_wal_replay_pause() succeeds, and then make the recovery
>>get out of the paused state.
> Yes that is.
>
> >It might be problematic to end the paused
>>state silently? So, to make the situation less confusing, what about
>>emitting a log message when ending the paused state because of
>>the promotion?
> But where to emit it? I think it not so good by emitting to log file,
> because the user will not check it everytime.

Yeah, I'm thinking to emit the message to log file, like the startup process
does in other places :)

> BTW, why
> CheckForStandbyTrigger() can not be called in backend.

Because

1) promote_signaled flag that IsPromoteSignaled() sees is set
only in the startup process
2) the trigger file can be removed or promote_trigger_file can be
changed after the backend detects it but before the startup process
does. That is, the result of the trigger file detection can be different
between the processes.

Of course we can change CheckForStandbyTrigger() so that it can
be called by backends, but I'm not sure if it's worth doing that.

Or another idea to reduce the delay between the request for
the promotion and the detection of it is to make the startup process
call CheckForStandbyTrigger() more frequently. Calling that every
replay of WAL record would be overkill and decrease the recovery
performance. Calling thst every WAL file might be ok. I'm not sure
if this is really improvement or not, though...

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 Amit Kapila 2020-04-01 10:59:16 Re: WAL usage calculation patch
Previous Message movead.li@highgo.ca 2020-04-01 09:56:14 Re: recovery_target_action=pause with confusing hint