Add option to control snapshot export to CREATE_REPLICATION_SLOT
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 14 Mar 2017 21:13:56 +0000 (17:13 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 14 Mar 2017 21:34:22 +0000 (17:34 -0400)
commiteb4da3e3807d2054bb05c3eb201cb9a363682f09
treec17c676ae946fa0df632217ec163987f155820ac
parent71504026556fc1494c9a7045aad9645f7d9e4cdf
Add option to control snapshot export to CREATE_REPLICATION_SLOT

We used to export snapshots unconditionally in CREATE_REPLICATION_SLOT
in the replication protocol, but several upcoming patches want more
control over what happens.

Suppress snapshot export in pg_recvlogical, which neither needs nor can
use the exported snapshot.  Since snapshot exporting can fail this
improves reliability.

This also paves the way for allowing the creation of replication slots
on standbys, which cannot export snapshots because they cannot allocate
new XIDs.

Author: Petr Jelinek <petr.jelinek@2ndquadrant.com>
doc/src/sgml/logicaldecoding.sgml
doc/src/sgml/protocol.sgml
src/backend/commands/subscriptioncmds.c
src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
src/backend/replication/repl_gram.y
src/backend/replication/repl_scanner.l
src/backend/replication/walsender.c
src/bin/pg_basebackup/streamutil.c
src/include/nodes/replnodes.h
src/include/replication/walreceiver.h