pgsql: Add option to control snapshot export to CREATE_REPLICATION_SLOT

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add option to control snapshot export to CREATE_REPLICATION_SLOT
Date: 2017-03-14 21:38:07
Message-ID: E1cnu8t-0004fv-Rc@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)jelinek(at)2ndquadrant(dot)com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/eb4da3e3807d2054bb05c3eb201cb9a363682f09

Modified Files
--------------
doc/src/sgml/logicaldecoding.sgml | 11 +++-
doc/src/sgml/protocol.sgml | 19 ++++++-
src/backend/commands/subscriptioncmds.c | 6 ++-
.../libpqwalreceiver/libpqwalreceiver.c | 15 ++++--
src/backend/replication/repl_gram.y | 43 ++++++++++++----
src/backend/replication/repl_scanner.l | 2 +
src/backend/replication/walsender.c | 58 ++++++++++++++++++++--
src/bin/pg_basebackup/streamutil.c | 5 ++
src/include/nodes/replnodes.h | 2 +-
src/include/replication/walreceiver.h | 6 +--
10 files changed, 141 insertions(+), 26 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-03-14 23:10:19 pgsql: Improve isolation tests infrastructure.
Previous Message Andres Freund 2017-03-14 20:09:17 Re: [COMMITTERS] pgsql: Add amcheck extension to contrib.