From 887227a1cc861d87ca0f175cf8bd1447554090eb Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 14 Apr 2017 13:58:46 -0400 Subject: Add option to modify sync commit per subscription This also changes default behaviour of subscription workers to synchronous_commit = off. Author: Petr Jelinek --- doc/src/sgml/catalogs.sgml | 10 ++++++++++ doc/src/sgml/ref/alter_subscription.sgml | 2 ++ doc/src/sgml/ref/create_subscription.sgml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) (limited to 'doc/src') diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 5883673448c..5254bb3025a 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -6530,6 +6530,16 @@ If true, the subscription is enabled and should be replicating. + + subsynccommit + text + + + Contains the value of the synchronous_commit + setting for the subscription workers. + + + subconninfo text diff --git a/doc/src/sgml/ref/alter_subscription.sgml b/doc/src/sgml/ref/alter_subscription.sgml index 640fac0a159..f71ee38b40c 100644 --- a/doc/src/sgml/ref/alter_subscription.sgml +++ b/doc/src/sgml/ref/alter_subscription.sgml @@ -26,6 +26,7 @@ ALTER SUBSCRIPTION name WITH ( where suboption can be: SLOT NAME = slot_name + | SYNCHRONOUS_COMMIT = synchronous_commit ALTER SUBSCRIPTION name SET PUBLICATION publication_name [, ...] { REFRESH WITH ( puboption [, ... ] ) | NOREFRESH } ALTER SUBSCRIPTION name REFRESH PUBLICATION WITH ( puboption [, ... ] ) @@ -91,6 +92,7 @@ ALTER SUBSCRIPTION name DISABLE CONNECTION 'conninfo' SLOT NAME = slot_name + SYNCHRONOUS_COMMIT = synchronous_commit These clauses alter properties originally set by diff --git a/doc/src/sgml/ref/create_subscription.sgml b/doc/src/sgml/ref/create_subscription.sgml index 3410d6fc8c2..3c51012df8b 100644 --- a/doc/src/sgml/ref/create_subscription.sgml +++ b/doc/src/sgml/ref/create_subscription.sgml @@ -32,6 +32,7 @@ CREATE SUBSCRIPTION subscription_nameslot_name | COPY DATA | NOCOPY DATA + | SYNCHRONOUS_COMMIT = synchronous_commit | NOCONNECT @@ -147,6 +148,36 @@ CREATE SUBSCRIPTION subscription_name + + SYNCHRONOUS_COMMIT = synchronous_commit + + + The value of this parameter overrides the + setting. The default value is + off. + + + + It is safe to use off for logical replication: If the + subscriber loses transactions because of missing synchronization, the + data will be resent from the publisher. + + + + A different setting might be appropriate when doing synchronous logical + replication. The logical replication workers report the positions of + writes and flushes to the publisher, and when using synchronous + replication, the publisher will wait for the actual flush. This means + that setting SYNCHRONOUS_COMMIT for the subscriber + to off when the subscription is used for synchronous + replication might increase the latency for COMMIT on + the publisher. In this scenario, it can be advantageous to set + SYNCHRONOUS_COMMIT to local or + higher. + + + + NOCONNECT -- cgit v1.2.3