how to achieve more consistency with more nodes
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 13 Sep 2017 16:22:10 +0000 (18:22 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 13 Sep 2017 16:22:10 +0000 (18:22 +0200)
postgresql.conf.master

index 88877a7..ce443e9 100644 (file)
@@ -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 -