From cd48f7160240497a2af3a6d897d5aed21642c064 Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Wed, 23 Nov 2022 08:59:44 +1100 Subject: [PATCH v3] Logical replication GUCs - consolidated. Combines all the logical replication configuration settings on one page with new Publisher/Subscriber sub-sections. --- doc/src/sgml/config.sgml | 80 +++------------------ doc/src/sgml/logical-replication.sgml | 132 ++++++++++++++++++++++++++++------ 2 files changed, 121 insertions(+), 91 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 24b1624..c61bb33 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -4166,6 +4166,11 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows across the cluster without problems if that is required. + + For logical replication configuration settings refer + to . + + Sending Servers @@ -4238,6 +4243,12 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows not pg_replication_origin) will prevent the server from starting. + + + See for more details + about setting max_replication_slots for logical + replication. + @@ -4926,75 +4937,6 @@ ANY num_sync ( - Subscribers - - - These settings control the behavior of a logical replication subscriber. - Their values on the publisher are irrelevant. - - - - Note that wal_receiver_timeout, - wal_receiver_status_interval and - wal_retrieve_retry_interval configuration parameters - affect the logical replication workers as well. - - - - - - max_logical_replication_workers (integer) - - max_logical_replication_workers configuration parameter - - - - - Specifies maximum number of logical replication workers. This includes - both apply workers and table synchronization workers. - - - Logical replication workers are taken from the pool defined by - max_worker_processes. - - - The default value is 4. This parameter can only be set at server - start. - - - - - - max_sync_workers_per_subscription (integer) - - max_sync_workers_per_subscription configuration parameter - - - - - Maximum number of synchronization workers per subscription. This - parameter controls the amount of parallelism of the initial data copy - during the subscription initialization or when new tables are added. - - - Currently, there can be only one synchronization worker per table. - - - The synchronization workers are taken from the pool defined by - max_logical_replication_workers. - - - The default value is 2. This parameter can only be set in the - postgresql.conf file or on the server command - line. - - - - - - - diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml index f875638..30f0358 100644 --- a/doc/src/sgml/logical-replication.sgml +++ b/doc/src/sgml/logical-replication.sgml @@ -1765,31 +1765,119 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER Configuration Settings - Logical replication requires several configuration options to be set. + Logical replication requires several configuration parameters to be set. - - On the publisher side, wal_level must be set to - logical, and max_replication_slots - must be set to at least the number of subscriptions expected to connect, - plus some reserve for table synchronization. And - max_wal_senders should be set to at least the same as - max_replication_slots plus the number of physical - replicas that are connected at the same time. - + + Publishers + + + must be set to logical. + + + + must be set to at least the number + of subscriptions expected to connect, plus some reserve for table + synchronization. + + + + should be set to at least the same as + max_replication_slots, plus the number of physical + replicas that are connected at the same time. + + + + + + Subscribers + + + must be set to at least the number + of subscriptions that will be added to the subscriber, plus some reserve for + table synchronization. + + + + The following settings control the behavior of a logical replication subscriber. + Their values on the publisher are irrelevant: + + + + + + max_logical_replication_workers (integer) + + max_logical_replication_workers configuration parameter + + + + + Specifies maximum number of logical replication workers. This must be set + to at least the number of subscriptions (for apply workers), plus some + reserve for the table synchronization workers. + + + Logical replication workers are taken from the pool defined by + . + + + The default value is 4. This parameter can only be set at server + start. + + + + + + max_sync_workers_per_subscription (integer) + + max_sync_workers_per_subscription configuration parameter + + + + + Maximum number of synchronization workers per subscription. This + parameter controls the amount of parallelism of the initial data copy + during the subscription initialization or when new tables are added. + + + Currently, there can be only one synchronization worker per table. + + + The synchronization workers are taken from the pool defined by + . + + + The default value is 2. This parameter can only be set in the + postgresql.conf file or on the server command + line. + + + + + + + + + Notes + + + Logical replication workers are also affected by + , + and + . + + + + Configuration parameter may need + to be adjusted to accommodate for replication workers, at least + ( + 1). + Some extensions and parallel queries also take worker slots from + max_worker_processes. + + + - - max_replication_slots must also be set on the subscriber. - It should be set to at least the number of subscriptions that will be added - to the subscriber, plus some reserve for table synchronization. - max_logical_replication_workers must be set to at least - the number of subscriptions, again plus some reserve for the table - synchronization. Additionally the max_worker_processes - may need to be adjusted to accommodate for replication workers, at least - (max_logical_replication_workers - + 1). Note that some extensions and parallel queries - also take worker slots from max_worker_processes. - -- 1.8.3.1