Extend the logical decoding output plugin API with stream methods.
authorAmit Kapila <[email protected]>
Tue, 28 Jul 2020 02:36:44 +0000 (08:06 +0530)
committerAmit Kapila <[email protected]>
Tue, 28 Jul 2020 02:39:44 +0000 (08:09 +0530)
commit45fdc9738b36d1068d3ad8fdb06436d6fd14436b
tree1168c9368d1d3c0e7daa47f82c5f8531ed0197c5
parent13838740f61fc455aa4196d257efc0b761daba1f
Extend the logical decoding output plugin API with stream methods.

This adds seven methods to the output plugin API, adding support for
 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  to "allow
the  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
contrib/test_decoding/test_decoding.c
doc/src/sgml/logicaldecoding.sgml
src/backend/replication/logical/logical.c
src/include/replication/logical.h
src/include/replication/output_plugin.h
src/include/replication/reorderbuffer.h