Re: Synchronous replication - patch status inquiry - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Synchronous replication - patch status inquiry
Date
Msg-id AANLkTi=baRnkqQXC6S_P-vE-TGh9VhPD+Z3KEQ30fopB@mail.gmail.com
Whole thread Raw
In response to Re: Synchronous replication - patch status inquiry  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Synchronous replication - patch status inquiry  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Thu, Sep 2, 2010 at 7:24 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
>> I propose a configuration file standbys.conf, in the master:
>>
>> # STANDBY NAME    SYNCHRONOUS   TIMEOUT
>> importantreplica  yes           100ms
>> tempcopy          no            10s
>
> Seems good. In fact, instead of yes/no, async/recv/fsync/replay is specified
> in SYNCHRONOUS field?
>
> OTOH, something like standby_name parameter should be introduced in
> recovery.conf.
>
> We should allow multiple standbys with the same name? Probably yes.
> We might need to add NUMBER field into the standbys.conf, in the future.

Here is the proposed detailed design:

standbys.conf
=============
# This is not initialized by initdb, so users need to create it under $PGDATA.   * The template is located in the
PREFIX/sharedirectory. 

# This is read by postmaster at the startup as well as pg_hba.conf is.   * In EXEC_BACKEND environement, each walsender
mustread it at the startup.   * This is ignored when max_wal_senders is zero.   * FATAL is emitted when standbys.conf
doesn'texist even if max_wal_senders     is positive. 

# SIGHUP makes only postmaser re-read the standbys.conf.   * New configuration doesn't affect the existing connections
tothe standbys,     i.e., it's used only for subsequent connections.   * XXX: Should the existing connections react to
newconfiguration? What if     new standbys.conf doesn't have the standby_name of the existing 
connection?

# The connection from the standby is rejected if its standby_name is not listed in standbys.conf.   * Multiple standbys
withthe same name are allowed. 

# The valid values of SYNCHRONOUS field are async, recv, fsync and replay.

standby_name
============
# This is new string-typed parameter in recovery.conf.   * XXX: Should standby_name and standby_mode be merged?

# Walreceiver sends this to the master when establishing the connection.

Comments? Is the above too complicated for the first step? If so, I'd
propose to just introduce new recovery.conf parameter like replication_mode
specifying the synchronization level, instead.

Regards,

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


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Synchronous replication - patch status inquiry
Next
From: Heikki Linnakangas
Date:
Subject: Re: Synchronous replication - patch status inquiry