devel version of the manual (2017-06-25 12:17:02) contains the following
paragraph documenting the CREATE SUBSCRIPTION command:
synchronous_commit (enum)
....
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.
It seems to me quite confusing.
1) I failed to find in the docs whether logical replication supports
synchronous mode at all and how it is configured.
2) Assuming it is supported, how setting synchronous_commit to off on
replica (subscriber) can increase COMMIT latency on master?
Obviously synchronous mode itself does increase it, but
- In physical replication (docs for synchronous_commit in section
19.5.1) only master's synchronous_commit value determines what
it waits for (e.g. 'remote_write' means writing to replica's OS),
and it seems natural to expect the same behaviour from logical
replication
- Even if replica's synchronous_commit somehow influences this,
'off' value is the lowest and fastest, isn't it?
Arseny Sher
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company