From 502c08bd6dc96699e1c48c662219bb92e067b8f9 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 13 Sep 2017 18:22:10 +0200 Subject: [PATCH] how to achieve more consistency with more nodes --- postgresql.conf.master | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/postgresql.conf.master b/postgresql.conf.master index 88877a7..ce443e9 100644 --- a/postgresql.conf.master +++ b/postgresql.conf.master @@ -181,6 +181,9 @@ wal_level = replica # minimal, replica, or logical # (turning this off can cause # unrecoverable data corruption) # https://www.postgresql.org/docs/9.6/static/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT +# XXX remote_apply should ensure that reads after writes do not get stale data from slave because of load-balancing +# but it also requires synchronous_standby_names and more than 1 slave otherwise we can not bootstrap cluster +# with this setting synchronous_commit = on # synchronization level; # off, local, remote_write, remote_apply, or on #wal_sync_method = fsync # the default is the first option @@ -246,9 +249,12 @@ max_replication_slots = 3 # max number of replication slots # These settings are ignored on a standby server. -#synchronous_standby_names = '' # standby servers that provide sync rep +#synchronous_standby_names = '*' # standby servers that provide sync rep # number of sync standbys and comma-separated list of application_name # from standby(s); '*' = all + +#synchronous_standby_names = 'walreceiver' # XXX for this to make sense here, we would need more than 1 slave + #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed # - Standby Servers - -- 2.20.1