Clarify the usage of max_replication_slots on the subscriber side.
authorAmit Kapila <akapila@postgresql.org>
Wed, 3 Mar 2021 04:47:47 +0000 (10:17 +0530)
committerAmit Kapila <akapila@postgresql.org>
Wed, 3 Mar 2021 04:47:47 +0000 (10:17 +0530)
It was not clear in the docs that the max_replication_slots is also used
to track replication origins on the subscriber side.

Author: Paul Martinez
Reviewed-by: Amit Kapila
Backpatch-through: 10 where logical replication was introduced
Discussion: https://postgr.es/m/CACqFVBZgwCN_pHnW6dMNCrOS7tiHCw6Retf_=U2Vvj3aUSeATw@mail.gmail.com

doc/src/sgml/config.sgml
doc/src/sgml/logical-replication.sgml

index efea453e6e6ecc5fdd4e298ab77a5e48c0993cca..ca0d9bd917e4b2fe2b089fba8cc919139dc0d6d9 100644 (file)
@@ -3891,6 +3891,17 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"'  # Windows
          to <literal>replica</literal> or higher to allow replication slots to
          be used.
         </para>
+
+        <para>
+         On the subscriber side, specifies how many replication origins (see
+         <xref linkend="replication-origins"/>) can be tracked simultaneously,
+         effectively limiting how many logical replication subscriptions can
+         be created on the server. Setting it a lower value than the current
+         number of tracked replication origins (reflected in
+         <link linkend="view-pg-replication-origin-status">pg_replication_origin_status</link>,
+         not <link linkend="catalog-pg-replication-origin">pg_replication_origin</link>)
+         will prevent the server from starting.
+        </para>
        </listitem>
       </varlistentry>
 
index cc9669392efe2f17d8f64334bca0f3ce70b48614..cd277e12edeef86fcd9daa2aa1b4f6b5b20b6157 100644 (file)
 
   <para>
    The subscriber also requires the <varname>max_replication_slots</varname>
-   to be set.  In this case it should be set to at least the number of
-   subscriptions that will be added to the subscriber.
-   <varname>max_logical_replication_workers</varname> must be set to at
-   least the number of subscriptions, again plus some reserve for the table
-   synchronization.  Additionally the <varname>max_worker_processes</varname>
+   be set to configure how many replication origins can be tracked.  In this
+   case it should be set to at least the number of subscriptions that will be
+   added to the subscriber.  <varname>max_logical_replication_workers</varname>
+   must be set to at least the number of subscriptions, again plus some reserve
+   for the table synchronization.  Additionally the <varname>max_worker_processes</varname>
    may need to be adjusted to accommodate for replication workers, at least
    (<varname>max_logical_replication_workers</varname>
    + <literal>1</literal>).  Note that some extensions and parallel queries