@@ -1507,8 +1507,9 @@ SET ENABLE_SEQSCAN TO OFF;
1507
1507
<para>
1508
1508
Specifies whether transaction commit will wait for WAL records
1509
1509
to be written to disk before the command returns a <quote>success</>
1510
- indication to the client. The default, and safe, setting is
1511
- <literal>on</>. When <literal>off</>, there can be a delay between
1510
+ indication to the client. Valid values are <literal>on</>,
1511
+ <literal>local</>, and <literal>off</>. The default, and safe, value
1512
+ is <literal>on</>. When <literal>off</>, there can be a delay between
1512
1513
when success is reported to the client and when the transaction is
1513
1514
really guaranteed to be safe against a server crash. (The maximum
1514
1515
delay is three times <xref linkend="guc-wal-writer-delay">.) Unlike
@@ -1522,6 +1523,19 @@ SET ENABLE_SEQSCAN TO OFF;
1522
1523
exact certainty about the durability of a transaction. For more
1523
1524
discussion see <xref linkend="wal-async-commit">.
1524
1525
</para>
1526
+ <para>
1527
+ If <xref linkend="guc-synchronous-standby-names"> is set, this
1528
+ parameter also controls whether or not transaction commit will wait
1529
+ for the transaction's WAL records to be flushed to disk and replicated
1530
+ to the standby server. The commit wait will last until a reply from
1531
+ the current synchronous standby indicates it has written the commit
1532
+ record of the transaction to durable storage. If synchronous
1533
+ replication is in use, it will normally be sensible either to wait
1534
+ both for WAL records to reach both the local and remote disks, or
1535
+ to allow the transaction to commit asynchronously. However, the
1536
+ special value <literal>local</> is available for transactions that
1537
+ wish to wait for local flush to disk, but not synchronous replication.
1538
+ </para>
1525
1539
<para>
1526
1540
This parameter can be changed at any time; the behavior for any
1527
1541
one transaction is determined by the setting in effect when it
@@ -2057,39 +2071,6 @@ SET ENABLE_SEQSCAN TO OFF;
2057
2071
</para>
2058
2072
2059
2073
<variablelist>
2060
- <varlistentry id="guc-synchronous-replication" xreflabel="synchronous_replication">
2061
- <term><varname>synchronous_replication</varname> (<type>boolean</type>)</term>
2062
- <indexterm>
2063
- <primary><varname>synchronous_replication</> configuration parameter</primary>
2064
- </indexterm>
2065
- <listitem>
2066
- <para>
2067
- Specifies whether transaction commit will wait for WAL records
2068
- to be replicated before the command returns a <quote>success</>
2069
- indication to the client. The default setting is <literal>off</>.
2070
- When <literal>on</>, there will be a delay while the client waits
2071
- for confirmation of successful replication. That delay will
2072
- increase depending upon the physical distance and network activity
2073
- between primary and standby. The commit wait will last until a
2074
- reply from the current synchronous standby indicates it has written
2075
- the commit record of the transaction to durable storage. This
2076
- parameter has no effect if
2077
- <xref linkend="guc-synchronous-standby-names"> is empty or
2078
- <xref linkend="guc-max-wal-senders"> is zero.
2079
- </para>
2080
- <para>
2081
- This parameter can be changed at any time; the
2082
- behavior for any one transaction is determined by the setting in
2083
- effect when it commits. It is therefore possible, and useful, to have
2084
- some transactions replicate synchronously and others asynchronously.
2085
- For example, to make a single multistatement transaction commit
2086
- asynchronously when the default is synchronous replication, issue
2087
- <command>SET LOCAL synchronous_replication TO OFF</> within the
2088
- transaction.
2089
- </para>
2090
- </listitem>
2091
- </varlistentry>
2092
-
2093
2074
<varlistentry id="guc-synchronous-standby-names" xreflabel="synchronous_standby_names">
2094
2075
<term><varname>synchronous_standby_names</varname> (<type>string</type>)</term>
2095
2076
<indexterm>
@@ -2098,7 +2079,7 @@ SET ENABLE_SEQSCAN TO OFF;
2098
2079
<listitem>
2099
2080
<para>
2100
2081
Specifies a priority ordered list of standby names that can offer
2101
- synchronous replication. At any one time there will be just one
2082
+ synchronous replication. At any one time there will be at most one
2102
2083
synchronous standby that will wake sleeping users following commit.
2103
2084
The synchronous standby will be the first named standby that is
2104
2085
both currently connected and streaming in real-time to the standby
@@ -2114,18 +2095,17 @@ SET ENABLE_SEQSCAN TO OFF;
2114
2095
not enforced for uniqueness. In case of duplicates one of the standbys
2115
2096
will be chosen to be the synchronous standby, though exactly which
2116
2097
one is indeterminate.
2117
- </para>
2118
- <para>
2119
- No value is set by default.
2120
2098
The special entry <literal>*</> matches any application_name, including
2121
2099
the default application name of <literal>walreceiver</>.
2122
2100
</para>
2123
2101
<para>
2124
- If a standby is removed from the list of servers then it will stop
2125
- being the synchronous standby, allowing another to take its place.
2126
- If the list is empty, synchronous replication will not be
2127
- possible, whatever the setting of <varname>synchronous_replication</>.
2128
- Standbys may also be added to the list without restarting the server.
2102
+ If no synchronous standby names are specified, then synchronous
2103
+ replication is not enabled and transaction commit will never wait for
2104
+ replication. This is the default configuration. Even when
2105
+ synchronous replication is enabled, individual transactions can be
2106
+ configured not to wait for replication by setting the
2107
+ <xref linkend="guc-synchronous-commit"> parameter to
2108
+ <literal>local</> or <literal>off</>.
2129
2109
</para>
2130
2110
</listitem>
2131
2111
</varlistentry>
0 commit comments