pgsql: Ability to advance replication slots

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Ability to advance replication slots
Date: 2018-01-17 11:42:23
Message-ID: E1ebm6p-000761-Hc@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Ability to advance replication slots

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
Reviewed-by: Simon Riggs

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9c7d06d60680c7f00d931233873dee81fdb311c6

Modified Files
--------------
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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-01-17 19:44:20 pgsql: Remove useless lookup of root partitioned rel in ExecInitModifyT
Previous Message Amit Langote 2018-01-17 09:10:50 Re: pgsql: Centralize json and jsonb handling of datetime types