Re: Synchronous replication: Promotion of Standby to Primary - Mailing list pgsql-hackers

From Kolb, Harald (NSN - DE/Munich)
Subject Re: Synchronous replication: Promotion of Standby to Primary
Date
Msg-id 8F6635BC27831E4BB0923D8A55136C26018DB67C@DEMUEXC005.nsn-intra.net
Whole thread Raw
In response to Re: Synchronous replication: Promotion of Standby to Primary  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Hello Fujii,

my name is Harald Kolb, I'm a colleague of Niranjan and I will continue
his community work since he's currently busy with other topics.
We are looking for a fast mechanism to activate the switchover. Therfore
we prefer to use a signal to trigger the standby to become primary,
since in our case the postmaster will be started via fork by a watchdog.
The originally intended solution via SIGTERM should be ok.
In the case the mechanism will be still based on the trigger file
concept, we would require to have in addition a signal to speed up the
trigger file detection, since the periodic check might be not fast
enough. It should be possible to reuse the SIGHUP signal. If it occurs,
the first action should be to check for the existence of the trigger
file. In the case it now exists, the switch to master mode is performed.
Otherwise the usual re-reading of the configuration files is performed.

Are there currently some concrete plannings how the promotion to primary
will be solved in the final solution ?

BR, Harald.



-----Original Message-----
From: ext Fujii Masao [mailto:masao.fujii@gmail.com]
Sent: Thursday, May 14, 2009 1:39 PM
To: K, Niranjan (NSN - IN/Bangalore)
Cc: Kolb, Harald (NSN - DE/Munich); Czichy, Thoralf (NSN - FI/Helsinki);
PostgreSQL-development
Subject: Re: Synchronous replication: Promotion of Standby to Primary

Hi,

On Thu, May 14, 2009 at 8:16 PM, Fujii Masao <masao.fujii@gmail.com>
wrote:
> Hi,
>
> On Mon, May 4, 2009 at 11:07 PM, K, Niranjan (NSN - IN/Bangalore)
> <niranjan.k@nsn.com> wrote:
>> Hi,
>>
>> Re-opening the discussion related to triggers to promote standby
server.
>> In the earlier dicussion, there were 2 proposals, Trigger based on
file
>> and trigger based on signals. I think there was no conclusion on
this.
>> http://archives.postgresql.org/pgsql-hackers/2008-12/msg01231.php
>>
>> According to the proposal, it seems to be better if signals are used
as
>> we can avoid checking the file existance in the loop. Or the other
>> approach is to use inotify (http://en.wikipedia.org/wiki/Inotify).
But
>> portability to other unix like OS is an issue to look for.
>>
>> Could you please get back which is being implemented/ considered for
>> promotion of standby?
>
> I had to choose the trigger file approach last time since the patch
> was also using warm-standby in part. But, in 8.5, synch-rep is
> going to work without warm-standby. So, we can choose also the
> trigger based on signals. In this case,

In this case, I'm not sure which signal can be used for the trigger.
SIGINT/QUIT/TERM/USR1 are already used in postmaster.
SIGUSR2 is already reserved for children according to the source
comment.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


pgsql-hackers by date:

Previous
From: Michael Meskes
Date:
Subject: Re: Warnings in compile
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] cleanup hashindex for pg_migrator hashindex compat mode (for 8.4)