diff options
author | Fujii Masao <fujii@postgresql.org> | 2017-04-19 02:58:28 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2017-04-19 02:58:28 +0900 |
commit | a790ed9f69ef584c12aec68d0d80e6b6b543bacb (patch) | |
tree | 1ec79e8d5ee5f397c09fbf1824fd458860ee99f1 /src | |
parent | e240a65c7dfc5ad80ab757ecb1aa9b9032c7f8ae (diff) | |
download | postgresql-a790ed9f69ef584c12aec68d0d80e6b6b543bacb.tar.gz postgresql-a790ed9f69ef584c12aec68d0d80e6b6b543bacb.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/replication/syncrep.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |