From: Fujii Masao <masao.fujii@gmail.com>
To: Guillaume Lelarge <guillaume@lelarge.info>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Add new replication mode synchronous_commit = 'write'.
Date: Sat, 14 Apr 2012 23:28:39 +0900
Message-ID: <CAHGQGwHccWN+eO3vxHS9oW3RN_0vanWE1wASdASryg+N5WrAdQ@mail.gmail.com> (raw)
In-Reply-To: <4F888546.3080304@lelarge.info>
References: <E1RpmtN-0000GY-33@gemulon.postgresql.org>
<CAJKUy5iCx2vm5ogMEm5eGTHjb45q-gvaSf0n+-o2X39HanE37g@mail.gmail.com>
<CAHGQGwFNc-chZGEHu7vmLj1=OL1_0mFzFesh_YtukW7U4mSZfw@mail.gmail.com>
<CA+TgmoZquUD5Lm0oMEEGDOMWpMAwOtjbA57VBEb5gru2qe8f=w@mail.gmail.com>
<CA+U5nMJCa=9T0P2+z5VCYvfG8ZT5=XfRYm_cuZaTFytCFyE_kg@mail.gmail.com>
<CAHGQGwF3xkrSBoox9C2zEw7BE6dDPXZDTbB7WMdjJGGuE-_25A@mail.gmail.com>
<CA+TgmoZ=ieWnQH7xePsQs9hePNyQhc2n8reSuwTzrbFpA6AxKQ@mail.gmail.com>
<4F8826DE0200002500046EE4@gw.wicourts.gov>
<4F888546.3080304@lelarge.info>
On Sat, Apr 14, 2012 at 4:57 AM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> On 04/13/2012 08:15 PM, Kevin Grittner wrote:
>>
>> Robert Haas<robertmhaas@gmail.com> wrote:
>>
>>> In my view, remote_write seems a lot more clear than write
>>
>>
>> +1
>>
>> I sure didn't understand it to mean remote_write when I read the
>> subject line.
>>
>
> Neither did I. So definitely +1.
+1
Patch attached.
Regards,
--
Fujii Masao
Attachments:remote_write_v1.patch (application/octet-stream, 5.7K) download
*** a/doc/src/sgml/config.sgml
--- b/doc/src/sgml/config.sgml
***************
*** 1626,1632 **** SET ENABLE_SEQSCAN TO OFF;
<para>
Specifies whether transaction commit will wait for WAL records
to be written to disk before the command returns a <quote>success</>
! indication to the client. Valid values are <literal>on</>, <literal>write</>,
<literal>local</>, and <literal>off</>. The default, and safe, value
is <literal>on</>. When <literal>off</>, there can be a delay between
when success is reported to the client and when the transaction is
--- 1626,1632 ----
<para>
Specifies whether transaction commit will wait for WAL records
to be written to disk before the command returns a <quote>success</>
! indication to the client. Valid values are <literal>on</>, <literal>remote_write</>,
<literal>local</>, and <literal>off</>. The default, and safe, value
is <literal>on</>. When <literal>off</>, there can be a delay between
when success is reported to the client and when the transaction is
***************
*** 1646,1652 **** SET ENABLE_SEQSCAN TO OFF;
If <xref linkend="guc-synchronous-standby-names"> is set, this
parameter also controls whether or not transaction commit will wait
for the transaction's WAL records to be flushed to disk and replicated
! to the standby server. When <literal>write</>, the commit wait will
last until a reply from the current synchronous standby indicates
it has received the commit record of the transaction to memory.
Normally this causes no data loss at the time of failover. However,
--- 1646,1652 ----
If <xref linkend="guc-synchronous-standby-names"> is set, this
parameter also controls whether or not transaction commit will wait
for the transaction's WAL records to be flushed to disk and replicated
! to the standby server. When <literal>remote_write</>, the commit wait will
last until a reply from the current synchronous standby indicates
it has received the commit record of the transaction to memory.
Normally this causes no data loss at the time of failover. However,
*** a/doc/src/sgml/high-availability.sgml
--- b/doc/src/sgml/high-availability.sgml
***************
*** 1011,1017 **** primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
</para>
<para>
! Setting <varname>synchronous_commit</> to <literal>write</> will
cause each commit to wait for confirmation that the standby has received
the commit record to memory. This provides a lower level of durability
than <literal>on</> does. However, it's a practically useful setting
--- 1011,1017 ----
</para>
<para>
! Setting <varname>synchronous_commit</> to <literal>remote_write</> will
cause each commit to wait for confirmation that the standby has received
the commit record to memory. This provides a lower level of durability
than <literal>on</> does. However, it's a practically useful setting
***************
*** 1075,1081 **** primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
<para>
Commits made when <varname>synchronous_commit</> is set to <literal>on</>
! or <literal>write</> will wait until the synchronous standby responds. The response
may never occur if the last, or only, standby should crash.
</para>
--- 1075,1081 ----
<para>
Commits made when <varname>synchronous_commit</> is set to <literal>on</>
! or <literal>remote_write</> will wait until the synchronous standby responds. The response
may never occur if the last, or only, standby should crash.
</para>
*** a/src/backend/utils/misc/guc.c
--- b/src/backend/utils/misc/guc.c
***************
*** 370,381 **** static const struct config_enum_entry constraint_exclusion_options[] = {
};
/*
! * Although only "on", "off", "write", and "local" are documented, we
* accept all the likely variants of "on" and "off".
*/
static const struct config_enum_entry synchronous_commit_options[] = {
{"local", SYNCHRONOUS_COMMIT_LOCAL_FLUSH, false},
! {"write", SYNCHRONOUS_COMMIT_REMOTE_WRITE, false},
{"on", SYNCHRONOUS_COMMIT_ON, false},
{"off", SYNCHRONOUS_COMMIT_OFF, false},
{"true", SYNCHRONOUS_COMMIT_ON, true},
--- 370,381 ----
};
/*
! * Although only "on", "off", "remote_write", and "local" are documented, we
* accept all the likely variants of "on" and "off".
*/
static const struct config_enum_entry synchronous_commit_options[] = {
{"local", SYNCHRONOUS_COMMIT_LOCAL_FLUSH, false},
! {"remote_write", SYNCHRONOUS_COMMIT_REMOTE_WRITE, false},
{"on", SYNCHRONOUS_COMMIT_ON, false},
{"off", SYNCHRONOUS_COMMIT_OFF, false},
{"true", SYNCHRONOUS_COMMIT_ON, true},
*** a/src/backend/utils/misc/postgresql.conf.sample
--- b/src/backend/utils/misc/postgresql.conf.sample
***************
*** 162,168 ****
#wal_level = minimal # minimal, archive, or hot_standby
# (change requires restart)
#fsync = on # turns forced synchronization on or off
! #synchronous_commit = on # synchronization level; on, off, or local
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync
--- 162,169 ----
#wal_level = minimal # minimal, archive, or hot_standby
# (change requires restart)
#fsync = on # turns forced synchronization on or off
! #synchronous_commit = on # synchronization level;
! # off, local, remote_write, or on
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: masao.fujii@gmail.com, guillaume@lelarge.info, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Add new replication mode synchronous_commit = 'write'.
In-Reply-To: <CAHGQGwHccWN+eO3vxHS9oW3RN_0vanWE1wASdASryg+N5WrAdQ@mail.gmail.com>
References: <E1RpmtN-0000GY-33@gemulon.postgresql.org> <CAJKUy5iCx2vm5ogMEm5eGTHjb45q-gvaSf0n+-o2X39HanE37g@mail.gmail.com> <CAHGQGwFNc-chZGEHu7vmLj1=OL1_0mFzFesh_YtukW7U4mSZfw@mail.gmail.com> <CA+TgmoZquUD5Lm0oMEEGDOMWpMAwOtjbA57VBEb5gru2qe8f=w@mail.gmail.com> <CA+U5nMJCa=9T0P2+z5VCYvfG8ZT5=XfRYm_cuZaTFytCFyE_kg@mail.gmail.com> <CAHGQGwF3xkrSBoox9C2zEw7BE6dDPXZDTbB7WMdjJGGuE-_25A@mail.gmail.com> <CA+TgmoZ=ieWnQH7xePsQs9hePNyQhc2n8reSuwTzrbFpA6AxKQ@mail.gmail.com> <4F8826DE0200002500046EE4@gw.wicourts.gov> <4F888546.3080304@lelarge.info> <CAHGQGwHccWN+eO3vxHS9oW3RN_0vanWE1wASdASryg+N5WrAdQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox