From a790ed9f69ef584c12aec68d0d80e6b6b543bacb Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Wed, 19 Apr 2017 02:58:28 +0900 Subject: Improve documentation and comment for quorum-based sync replication. Author: Masahiko Sawada, heavily modified by me Discussion: http://postgr.es/m/CAHGQGwEKOw=SmPLxJzkBsH6wwDBgOnVz46QjHbtsiZ-d-2RGUg@mail.gmail.com --- src/backend/replication/syncrep.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c index 20a1441f0a7..25c67aaac72 100644 --- a/src/backend/replication/syncrep.c +++ b/src/backend/replication/syncrep.c @@ -53,6 +53,10 @@ * in the list. All the standbys appearing in the list are considered as * candidates for quorum synchronous standbys. * + * If neither FIRST nor ANY is specified, FIRST is used as the method. + * This is for backward compatibility with 9.6 or before where only a + * priority-based sync replication was supported. + * * Before the standbys chosen from synchronous_standby_names can * become the synchronous standbys they must have caught up with * the primary; that may take some time. Once caught up, @@ -629,6 +633,7 @@ SyncRepGetNthLatestSyncRecPtr(XLogRecPtr *writePtr, XLogRecPtr *flushPtr, i++; } + /* Sort each array in descending order */ qsort(write_array, len, sizeof(XLogRecPtr), cmp_lsn); qsort(flush_array, len, sizeof(XLogRecPtr), cmp_lsn); qsort(apply_array, len, sizeof(XLogRecPtr), cmp_lsn); -- cgit v1.2.3