Re: BUG #13368: standby cluster immediately promotes after pg_basebackup from previously promoted master - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #13368: standby cluster immediately promotes after pg_basebackup from previously promoted master
Date
Msg-id CAB7nPqSrL88T0ep6mHK-fNiQY26rW3Hj1-4A6LLnaoNQc=-JkQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13368: standby cluster immediately promotes after pg_basebackup from previously promoted master  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: BUG #13368: standby cluster immediately promotes after pg_basebackup from previously promoted master  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-bugs
On Thu, Jul 2, 2015 at 10:00 PM, Fujii Masao wrote:
>> At the beginning of
>> StartupXLOG() before parsing recovery.conf we could check for the
>> existence of promotion trigger files and unlink them unconditionally.
>
> There seems to be still race condition: postmaster can receive SIGUSR1
> before the startup process removes the promotion trigger file. Then
> the variable promote_triggered can be set to true unexpectedly.

Ah, yes. That's indeed possible.

> So, what about making postmaster remove the trigger file unconditionally
> before the startup process is forked, instead? For example, just after
> PostmasterMain() calls RemovePgTempFiles()?

Sounds fine, no other processes are running at this point.
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: mailrsatish@gmail.com
Date:
Subject: BUG #13482: Unable SET DATA TYPE geometry(MultiPolygon) with other geometry type
Next
From: Fujii Masao
Date:
Subject: Re: BUG #13368: standby cluster immediately promotes after pg_basebackup from previously promoted master