Ability to advance replication slots

Enterprise / PostgreSQL - Simon Riggs [2ndQuadrant.com] - 17 January 2018 11:38 EST

Ability to advance both physical and logical replication slots using a new user function pg_replication_slot_advance().

For logical advance that means records are consumed as fast as possible and changes are not given to output plugin for sending. Makes 2nd phase (after we reached SNAPBUILD_FULL_SNAPSHOT) of replication slot creation faster, especially when there are big transactions as the reorder buffer does not have to deal with data changes and does not have to spill to disk.

Author: Petr Jelinek

9c7d06d606 Ability to advance replication slots
contrib/test_decoding/expected/slot.out | 30 ++++
contrib/test_decoding/sql/slot.sql | 15 ++
doc/src/sgml/func.sgml | 19 +++
src/backend/replication/logical/decode.c | 44 ++++--
src/backend/replication/logical/logical.c | 30 +++-
src/backend/replication/logical/logicalfuncs.c | 1 +
src/backend/replication/slotfuncs.c | 200 +++++++++++++++++++++++++
src/backend/replication/walsender.c | 1 +
src/include/catalog/pg_proc.h | 2 +
src/include/replication/logical.h | 8 +
10 files changed, 333 insertions(+), 17 deletions(-)

Upstream: git.postgresql.org


  • Share