pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Extend the logical decoding output plugin API with stream method
Date: Tue, 28 Jul 2020 02:46:30 +0000
Message-ID: <E1k0FdO-0005sH-Gk@gemulon.postgresql.org> (raw)

Extend the logical decoding output plugin API with stream methods.

This adds seven methods to the output plugin API, adding support for
streaming changes of large in-progress transactions.

* stream_start
* stream_stop
* stream_abort
* stream_commit
* stream_change
* stream_message
* stream_truncate

Most of this is a simple extension of the existing methods, with
the semantic difference that the transaction (or subtransaction)
is incomplete and may be aborted later (which is something the
regular API does not really need to deal with).

This also extends the 'test_decoding' plugin, implementing these
new stream methods.

The stream_start/start_stop are used to demarcate a chunk of changes
streamed for a particular toplevel transaction.

This commit simply adds these new APIs and the upcoming patch to "allow
the streaming mode in ReorderBuffer" will use these APIs.

Author: Tomas Vondra, Dilip Kumar, Amit Kapila
Reviewed-by: Amit Kapila
Tested-by: Neha Sharma and Mahendra Singh Thalor
Discussion: https://postgr.es/m/688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/45fdc9738b36d1068d3ad8fdb06436d6fd14436b

Modified Files
--------------
contrib/test_decoding/test_decoding.c     | 176 +++++++++++++++
doc/src/sgml/logicaldecoding.sgml         | 218 +++++++++++++++++++
src/backend/replication/logical/logical.c | 351 ++++++++++++++++++++++++++++++
src/include/replication/logical.h         |   5 +
src/include/replication/output_plugin.h   |  69 ++++++
src/include/replication/reorderbuffer.h   |  59 +++++
6 files changed, 878 insertions(+)



Message-ID: <E1k0FdO-0005sH-Gk@gemulon.postgresql.org>
Permalink:  ../E1k0FdO-0005sH-Gk@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1k0FdO-0005sH-Gk@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org
  Subject: Re: pgsql: Extend the logical decoding output plugin API with stream method
  In-Reply-To: <E1k0FdO-0005sH-Gk@gemulon.postgresql.org>
  References: <E1k0FdO-0005sH-Gk@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox