Re: BUG #13368: standby cluster immediately promotes after pg_basebackup from previously promoted master

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Feike Steenbergen <feikesteenbergen(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13368: standby cluster immediately promotes after pg_basebackup from previously promoted master
Date: 2015-07-03 07:03:03
Message-ID: CAB7nPqSrL88T0ep6mHK-fNiQY26rW3Hj1-4A6LLnaoNQc=-JkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
20150703_ignore_promote_file_v3.patch binary/octet-stream 3.5 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message olivier.gosseaume 2015-07-03 09:02:17 BUG #13484: Performance problem with logical decoding
Previous Message sammit.karekar 2015-07-03 05:43:00 BUG #13483: Installation fails