@@ -1962,24 +1962,26 @@ SET ENABLE_SEQSCAN TO OFF;
1962
1962
<para>
1963
1963
These settings control the behavior of the built-in
1964
1964
<firstterm>streaming replication</> feature (see
1965
- <xref linkend="streaming-replication">).
1966
- Some parameters must be set on the master server, while others must be
1967
- set on the standby server(s) that will receive replication data.
1965
+ <xref linkend="streaming-replication">). Servers will be either a
1966
+ Master or a Standby server. Masters can send data, while Standby(s)
1967
+ are always receivers of replicated data. When cascading replication
1968
+ (see <xref linkend="cascading-replication">) is used, Standby server(s)
1969
+ can also be senders, as well as receivers.
1970
+ Parameters are mainly for Sending and Standby servers, though some
1971
+ parameters have meaning only on the Master server. Settings may vary
1972
+ across the cluster without problems if that is required.
1968
1973
</para>
1969
1974
1970
- <sect2 id="runtime-config-replication-master ">
1971
- <title>Master Server</title>
1975
+ <sect2 id="runtime-config-replication-sender ">
1976
+ <title>Sending Server(s) </title>
1972
1977
1973
1978
<para>
1974
- These parameters can be set on the primary server that is
1979
+ These parameters can be set on any server that is
1975
1980
to send replication data to one or more standby servers.
1976
- Note that in addition to these parameters,
1977
- <xref linkend="guc-wal-level"> must be set appropriately on the master
1978
- server, and you will typically want to enable WAL archiving as
1979
- well (see <xref linkend="runtime-config-wal-archiving">).
1980
- The values of these parameters on standby servers are irrelevant,
1981
- although you may wish to set them there in preparation for the
1982
- possibility of a standby becoming the master.
1981
+ The master is always a sending server, so these parameters must
1982
+ always be set on the master.
1983
+ The role and meaning of these parameters does not change after a
1984
+ standby becomes the master.
1983
1985
</para>
1984
1986
1985
1987
<variablelist>
@@ -2034,10 +2036,11 @@ SET ENABLE_SEQSCAN TO OFF;
2034
2036
<filename>pg_xlog</>
2035
2037
directory, in case a standby server needs to fetch them for streaming
2036
2038
replication. Each segment is normally 16 megabytes. If a standby
2037
- server connected to the primary falls behind by more than
2038
- <varname>wal_keep_segments</> segments, the primary might remove
2039
+ server connected to the sending server falls behind by more than
2040
+ <varname>wal_keep_segments</> segments, the sending server might remove
2039
2041
a WAL segment still needed by the standby, in which case the
2040
- replication connection will be terminated. (However, the standby
2042
+ replication connection will be terminated. Downstream connections
2043
+ will also eventually fail as a result. (However, the standby
2041
2044
server can recover by fetching the segment from archive, if WAL
2042
2045
archiving is in use.)
2043
2046
</para>
@@ -2050,42 +2053,13 @@ SET ENABLE_SEQSCAN TO OFF;
2050
2053
doesn't keep any extra segments for standby purposes, so the number
2051
2054
of old WAL segments available to standby servers is a function of
2052
2055
the location of the previous checkpoint and status of WAL
2053
- archiving. This parameter has no effect on restartpoints.
2056
+ archiving.
2054
2057
This parameter can only be set in the
2055
2058
<filename>postgresql.conf</> file or on the server command line.
2056
2059
</para>
2057
2060
</listitem>
2058
2061
</varlistentry>
2059
2062
2060
- <varlistentry id="guc-vacuum-defer-cleanup-age" xreflabel="vacuum_defer_cleanup_age">
2061
- <term><varname>vacuum_defer_cleanup_age</varname> (<type>integer</type>)</term>
2062
- <indexterm>
2063
- <primary><varname>vacuum_defer_cleanup_age</> configuration parameter</primary>
2064
- </indexterm>
2065
- <listitem>
2066
- <para>
2067
- Specifies the number of transactions by which <command>VACUUM</> and
2068
- <acronym>HOT</> updates will defer cleanup of dead row versions. The
2069
- default is zero transactions, meaning that dead row versions can be
2070
- removed as soon as possible, that is, as soon as they are no longer
2071
- visible to any open transaction. You may wish to set this to a
2072
- non-zero value on a primary server that is supporting hot standby
2073
- servers, as described in <xref linkend="hot-standby">. This allows
2074
- more time for queries on the standby to complete without incurring
2075
- conflicts due to early cleanup of rows. However, since the value
2076
- is measured in terms of number of write transactions occurring on the
2077
- primary server, it is difficult to predict just how much additional
2078
- grace time will be made available to standby queries.
2079
- This parameter can only be set in the <filename>postgresql.conf</>
2080
- file or on the server command line.
2081
- </para>
2082
- <para>
2083
- You should also consider setting <varname>hot_standby_feedback</>
2084
- as an alternative to using this parameter.
2085
- </para>
2086
- </listitem>
2087
- </varlistentry>
2088
-
2089
2063
<varlistentry id="guc-replication-timeout" xreflabel="replication_timeout">
2090
2064
<term><varname>replication_timeout</varname> (<type>integer</type>)</term>
2091
2065
<indexterm>
@@ -2095,7 +2069,7 @@ SET ENABLE_SEQSCAN TO OFF;
2095
2069
<para>
2096
2070
Terminate replication connections that are inactive longer
2097
2071
than the specified number of milliseconds. This is useful for
2098
- the primary server to detect a standby crash or network outage.
2072
+ the sending server to detect a standby crash or network outage.
2099
2073
A value of zero disables the timeout mechanism. This parameter
2100
2074
can only be set in
2101
2075
the <filename>postgresql.conf</> file or on the server command line.
@@ -2110,6 +2084,26 @@ SET ENABLE_SEQSCAN TO OFF;
2110
2084
</listitem>
2111
2085
</varlistentry>
2112
2086
2087
+ </variablelist>
2088
+ </sect2>
2089
+
2090
+ <sect2 id="runtime-config-replication-master">
2091
+ <title>Master Server</title>
2092
+
2093
+ <para>
2094
+ These parameters can be set on the master/primary server that is
2095
+ to send replication data to one or more standby servers.
2096
+ Note that in addition to these parameters,
2097
+ <xref linkend="guc-wal-level"> must be set appropriately on the master
2098
+ server, and may also want to enable WAL archiving as
2099
+ well (see <xref linkend="runtime-config-wal-archiving">).
2100
+ The values of these parameters on standby servers are irrelevant,
2101
+ although you may wish to set them there in preparation for the
2102
+ possibility of a standby becoming the master.
2103
+ </para>
2104
+
2105
+ <variablelist>
2106
+
2113
2107
<varlistentry id="guc-synchronous-standby-names" xreflabel="synchronous_standby_names">
2114
2108
<term><varname>synchronous_standby_names</varname> (<type>string</type>)</term>
2115
2109
<indexterm>
@@ -2161,6 +2155,35 @@ SET ENABLE_SEQSCAN TO OFF;
2161
2155
</listitem>
2162
2156
</varlistentry>
2163
2157
2158
+ <varlistentry id="guc-vacuum-defer-cleanup-age" xreflabel="vacuum_defer_cleanup_age">
2159
+ <term><varname>vacuum_defer_cleanup_age</varname> (<type>integer</type>)</term>
2160
+ <indexterm>
2161
+ <primary><varname>vacuum_defer_cleanup_age</> configuration parameter</primary>
2162
+ </indexterm>
2163
+ <listitem>
2164
+ <para>
2165
+ Specifies the number of transactions by which <command>VACUUM</> and
2166
+ <acronym>HOT</> updates will defer cleanup of dead row versions. The
2167
+ default is zero transactions, meaning that dead row versions can be
2168
+ removed as soon as possible, that is, as soon as they are no longer
2169
+ visible to any open transaction. You may wish to set this to a
2170
+ non-zero value on a primary server that is supporting hot standby
2171
+ servers, as described in <xref linkend="hot-standby">. This allows
2172
+ more time for queries on the standby to complete without incurring
2173
+ conflicts due to early cleanup of rows. However, since the value
2174
+ is measured in terms of number of write transactions occurring on the
2175
+ primary server, it is difficult to predict just how much additional
2176
+ grace time will be made available to standby queries.
2177
+ This parameter can only be set in the <filename>postgresql.conf</>
2178
+ file or on the server command line.
2179
+ </para>
2180
+ <para>
2181
+ You should also consider setting <varname>hot_standby_feedback</>
2182
+ on standby server(s) as an alternative to using this parameter.
2183
+ </para>
2184
+ </listitem>
2185
+ </varlistentry>
2186
+
2164
2187
</variablelist>
2165
2188
</sect2>
2166
2189
@@ -2261,7 +2284,7 @@ SET ENABLE_SEQSCAN TO OFF;
2261
2284
<para>
2262
2285
Specifies the minimum frequency for the WAL receiver
2263
2286
process on the standby to send information about replication progress
2264
- to the primary, where it can be seen using the
2287
+ to the primary or upstream standby , where it can be seen using the
2265
2288
<link linkend="monitoring-stats-views-table">
2266
2289
<literal>pg_stat_replication</></link> view. The standby will report
2267
2290
the last transaction log position it has written, the last position it
@@ -2276,7 +2299,7 @@ SET ENABLE_SEQSCAN TO OFF;
2276
2299
The default value is 10 seconds.
2277
2300
</para>
2278
2301
<para>
2279
- When <xref linkend="guc-replication-timeout"> is enabled on the primary ,
2302
+ When <xref linkend="guc-replication-timeout"> is enabled on a sending server ,
2280
2303
<varname>wal_receiver_status_interval</> must be enabled, and its value
2281
2304
must be less than the value of <varname>replication_timeout</>.
2282
2305
</para>
@@ -2291,6 +2314,7 @@ SET ENABLE_SEQSCAN TO OFF;
2291
2314
<listitem>
2292
2315
<para>
2293
2316
Specifies whether or not a hot standby will send feedback to the primary
2317
+ or upstream standby
2294
2318
about queries currently executing on the standby. This parameter can
2295
2319
be used to eliminate query cancels caused by cleanup records, but
2296
2320
can cause database bloat on the primary for some workloads.
@@ -2299,6 +2323,11 @@ SET ENABLE_SEQSCAN TO OFF;
2299
2323
<literal>off</literal>. This parameter can only be set in the
2300
2324
<filename>postgresql.conf</> file or on the server command line.
2301
2325
</para>
2326
+ <para>
2327
+ If cascaded replication is in use the feedback is passed upstream
2328
+ until it eventually reaches the primary. Standbys make no other use
2329
+ of feedback they receive other than to pass upstream.
2330
+ </para>
2302
2331
</listitem>
2303
2332
</varlistentry>
2304
2333
0 commit comments