postgresql/src
Fujii Masao 3901fd70cc Support quorum-based synchronous replication.
This feature is also known as "quorum commit" especially in discussion
on pgsql-hackers.

This commit adds the following new syntaxes into synchronous_standby_names
GUC. By using FIRST and ANY keywords, users can specify the method to
choose synchronous standbys from the listed servers.

  FIRST num_sync (standby_name [, ...])
  ANY num_sync (standby_name [, ...])

The keyword FIRST specifies a priority-based synchronous replication
which was available also in 9.6 or before. This method makes transaction
commits wait until their WAL records are replicated to num_sync
synchronous standbys chosen based on their priorities.

The keyword ANY specifies a quorum-based synchronous replication
and makes transaction commits wait until their WAL records are
replicated to *at least* num_sync listed standbys. In this method,
the values of sync_state.pg_stat_replication for the listed standbys
are reported as "quorum". The priority is still assigned to each standby,
but not used in this method.

The existing syntaxes having neither FIRST nor ANY keyword are still
supported. They are the same as new syntax with FIRST keyword, i.e.,
a priorirty-based synchronous replication.

Author: Masahiko Sawada
Reviewed-By: Michael Paquier, Amit Kapila and me
Discussion: <CAD21AoAACi9NeC_ecm+Vahm+MMA6nYh=Kqs3KB3np+MBOS_gZg@mail.gmail.com>

Many thanks to the various individuals who were involved in
discussing and developing this feature.
2016-12-19 21:15:30 +09:00
..
backend Support quorum-based synchronous replication. 2016-12-19 21:15:30 +09:00
bin Add missing newline in message 2016-12-15 16:45:31 +01:00
common Rename "pg_xlog" directory to "pg_wal". 2016-10-20 11:32:18 -04:00
fe_utils Restore psql's SIGPIPE setting if popen() fails. 2016-12-07 12:39:24 -05:00
include Support quorum-based synchronous replication. 2016-12-19 21:15:30 +09:00
interfaces Use "%option prefix" to set API names in ecpg's lexer. 2016-12-11 14:54:25 -05:00
makefiles Provide NO_INSTALLCHECK option for pgxs. 2016-11-14 14:53:07 -08:00
pl Improve handling of array elements as getdiag_targets and cursor_variables. 2016-12-13 16:33:03 -05:00
port Replace PostmasterRandom() with a stronger source, second attempt. 2016-12-05 13:42:59 +02:00
template Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
test Support quorum-based synchronous replication. 2016-12-19 21:15:30 +09:00
timezone Sync our copy of the timezone library with IANA release tzcode2016j. 2016-12-15 14:32:42 -05:00
tools MSVC: Position MSBFLAGS after flags it might override. 2016-12-18 18:12:23 -05:00
tutorial Update copyright for 2016 2016-01-02 13:33:40 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Install TAP test infrastructure so it's available for extension testing. 2016-09-23 15:50:00 -04:00
Makefile.global.in Replace PostmasterRandom() with a stronger source, second attempt. 2016-12-05 13:42:59 +02:00
Makefile.shlib Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00