diff options
author | Tomas Vondra <tomas.vondra@postgresql.org> | 2022-04-07 18:13:13 +0200 |
---|---|---|
committer | Tomas Vondra <tomas.vondra@postgresql.org> | 2022-04-07 20:06:36 +0200 |
commit | 2c7ea57e56ca5f668c32d4266e0a3e45b455bef5 (patch) | |
tree | c4b80357147f2212e571dd1a4522c2b73068a783 /doc/src/sgml/logicaldecoding.sgml | |
parent | d7ab2a9a3c0a2800ab36bb48d1cc97370067777e (diff) | |
download | postgresql-2c7ea57e56ca5f668c32d4266e0a3e45b455bef5.tar.gz postgresql-2c7ea57e56ca5f668c32d4266e0a3e45b455bef5.zip |
Revert "Logical decoding of sequences"
This reverts a sequence of commits, implementing features related to
logical decoding and replication of sequences:
- 0da92dc530c9251735fc70b20cd004d9630a1266
- 80901b32913ffa59bf157a4d88284b2b3a7511d9
- b779d7d8fdae088d70da5ed9fcd8205035676df3
- d5ed9da41d96988d905b49bebb273a9b2d6e2915
- a180c2b34de0989269fdb819bff241a249bf5380
- 75b1521dae1ff1fde17fda2e30e591f2e5d64b6a
- 2d2232933b02d9396113662e44dca5f120d6830e
- 002c9dd97a0c874fd1693a570383e2dd38cd40d5
- 05843b1aa49df2ecc9b97c693b755bd1b6f856a9
The implementation has issues, mostly due to combining transactional and
non-transactional behavior of sequences. It's not clear how this could
be fixed, but it'll require reworking significant part of the patch.
Discussion: https://postgr.es/m/95345a19-d508-63d1-860a-f5c2f41e8d40@enterprisedb.com
Diffstat (limited to 'doc/src/sgml/logicaldecoding.sgml')
-rw-r--r-- | doc/src/sgml/logicaldecoding.sgml | 65 |
1 files changed, 5 insertions, 60 deletions
diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml index a6ea6ff3fcf..8b2c31a87fa 100644 --- a/doc/src/sgml/logicaldecoding.sgml +++ b/doc/src/sgml/logicaldecoding.sgml @@ -458,7 +458,6 @@ typedef struct OutputPluginCallbacks LogicalDecodeTruncateCB truncate_cb; LogicalDecodeCommitCB commit_cb; LogicalDecodeMessageCB message_cb; - LogicalDecodeSequenceCB sequence_cb; LogicalDecodeFilterByOriginCB filter_by_origin_cb; LogicalDecodeShutdownCB shutdown_cb; LogicalDecodeFilterPrepareCB filter_prepare_cb; @@ -473,7 +472,6 @@ typedef struct OutputPluginCallbacks LogicalDecodeStreamCommitCB stream_commit_cb; LogicalDecodeStreamChangeCB stream_change_cb; LogicalDecodeStreamMessageCB stream_message_cb; - LogicalDecodeStreamSequenceCB stream_sequence_cb; LogicalDecodeStreamTruncateCB stream_truncate_cb; } OutputPluginCallbacks; @@ -483,11 +481,9 @@ typedef void (*LogicalOutputPluginInit) (struct OutputPluginCallbacks *cb); and <function>commit_cb</function> callbacks are required, while <function>startup_cb</function>, <function>filter_by_origin_cb</function>, <function>truncate_cb</function>, - <function>sequence_cb</function>, and <function>shutdown_cb</function> are - optional. If <function>truncate_cb</function> is not set but a + and <function>shutdown_cb</function> are optional. + If <function>truncate_cb</function> is not set but a <command>TRUNCATE</command> is to be decoded, the action will be ignored. - Similarly, if <function>sequence_cb</function> is not set and a sequence - change is to be decoded, the action will be ignored. </para> <para> @@ -496,8 +492,7 @@ typedef void (*LogicalOutputPluginInit) (struct OutputPluginCallbacks *cb); <function>stream_stop_cb</function>, <function>stream_abort_cb</function>, <function>stream_commit_cb</function>, <function>stream_change_cb</function>, and <function>stream_prepare_cb</function> - are required, while <function>stream_message_cb</function>, - <function>stream_sequence_cb</function>, and + are required, while <function>stream_message_cb</function> and <function>stream_truncate_cb</function> are optional. </para> @@ -813,35 +808,6 @@ typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx, </para> </sect3> - <sect3 id="logicaldecoding-output-plugin-sequence"> - <title>Sequence Callback</title> - - <para> - The optional <function>sequence_cb</function> callback is called for - actions that update a sequence value. -<programlisting> -typedef void (*LogicalDecodeSequenceCB) (struct LogicalDecodingContext *ctx, - ReorderBufferTXN *txn, - XLogRecPtr sequence_lsn, - Relation rel, - bool transactional, - int64 last_value, - int64 log_cnt, - bool is_called); -</programlisting> - The <parameter>txn</parameter> parameter contains meta information about - the transaction the sequence change is part of. Note however that for - non-transactional increments, the transaction may be either NULL or not - NULL, depending on if the transaction already has an XID assigned. - The <parameter>sequence_lsn</parameter> has the WAL location of the - sequence update. <parameter>transactional</parameter> says if the - sequence has to be replayed as part of the transaction or directly. - - The <parameter>last_value</parameter>, <parameter>log_cnt</parameter> and - <parameter>is_called</parameter> parameters describe the sequence change. - </para> - </sect3> - <sect3 id="logicaldecoding-output-plugin-filter-prepare"> <title>Prepare Filter Callback</title> @@ -1051,26 +1017,6 @@ typedef void (*LogicalDecodeStreamMessageCB) (struct LogicalDecodingContext *ctx </para> </sect3> - <sect3 id="logicaldecoding-output-plugin-stream-sequence"> - <title>Stream Sequence Callback</title> - <para> - The optional <function>stream_sequence_cb</function> callback is called - for actions that change a sequence in a block of streamed changes - (demarcated by <function>stream_start_cb</function> and - <function>stream_stop_cb</function> calls). -<programlisting> -typedef void (*LogicalDecodeStreamSequenceCB) (struct LogicalDecodingContext *ctx, - ReorderBufferTXN *txn, - XLogRecPtr sequence_lsn, - Relation rel, - bool transactional, - int64 last_value, - int64 log_cnt, - bool is_called); -</programlisting> - </para> - </sect3> - <sect3 id="logicaldecoding-output-plugin-stream-truncate"> <title>Stream Truncate Callback</title> <para> @@ -1251,9 +1197,8 @@ OutputPluginWrite(ctx, true); in-progress transactions. There are multiple required streaming callbacks (<function>stream_start_cb</function>, <function>stream_stop_cb</function>, <function>stream_abort_cb</function>, <function>stream_commit_cb</function> - and <function>stream_change_cb</function>) and multiple optional callbacks - (<function>stream_message_cb</function>, <function>stream_sequence_cb</function>, - and <function>stream_truncate_cb</function>). + and <function>stream_change_cb</function>) and two optional callbacks + (<function>stream_message_cb</function> and <function>stream_truncate_cb</function>). Also, if streaming of two-phase commands is to be supported, then additional callbacks must be provided. (See <xref linkend="logicaldecoding-two-phase-commits"/> for details). |