From 9bd601fa82ceeaf09573ce31eb3c081b4ae7a45d Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sat, 23 Jan 2021 21:03:37 -0600 Subject: [PATCH 16/18] doc review for logical decoding of prepared xacts 0aa8a01d04c8fe200b7a106878eebc3d0af9105c --- doc/src/sgml/logicaldecoding.sgml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml index b854f2ccfc..71e9f36b8e 100644 --- a/doc/src/sgml/logicaldecoding.sgml +++ b/doc/src/sgml/logicaldecoding.sgml @@ -791,9 +791,9 @@ typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx, The optional filter_prepare_cb callback is called to determine whether data that is part of the current - two-phase commit transaction should be considered for decode - at this prepare stage or as a regular one-phase transaction at - COMMIT PREPARED time later. To signal that + two-phase commit transaction should be considered for decoding + at this prepare stage or later as a regular one-phase transaction at + COMMIT PREPARED time. To signal that decoding should be skipped, return true; false otherwise. When the callback is not defined, false is assumed (i.e. nothing is @@ -820,11 +820,11 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx The required begin_prepare_cb callback is called whenever the start of a prepared transaction has been decoded. The gid field, which is part of the - txn parameter can be used in this callback to - check if the plugin has already received this prepare in which case it + txn parameter, can be used in this callback to + check if the plugin has already received this PREPARE in which case it can skip the remaining changes of the transaction. This can only happen - if the user restarts the decoding after receiving the prepare for a - transaction but before receiving the commit prepared say because of some + if the user restarts the decoding after receiving the PREPARE for a + transaction but before receiving the COMMIT PREPARED, say because of some error. typedef void (*LogicalDecodeBeginPrepareCB) (struct LogicalDecodingContext *ctx, @@ -842,7 +842,7 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx decoded. The change_cb callback for all modified rows will have been called before this, if there have been any modified rows. The gid field, which is part of the - txn parameter can be used in this callback. + txn parameter, can be used in this callback. typedef void (*LogicalDecodePrepareCB) (struct LogicalDecodingContext *ctx, ReorderBufferTXN *txn, @@ -856,9 +856,9 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx The required commit_prepared_cb callback is called - whenever a transaction commit prepared has been decoded. The + whenever a transaction COMMIT PREPARED has been decoded. The gid field, which is part of the - txn parameter can be used in this callback. + txn parameter, can be used in this callback. typedef void (*LogicalDecodeCommitPreparedCB) (struct LogicalDecodingContext *ctx, ReorderBufferTXN *txn, @@ -872,15 +872,15 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx The required rollback_prepared_cb callback is called - whenever a transaction rollback prepared has been decoded. The + whenever a transaction ROLLBACK PREPARED has been decoded. The gid field, which is part of the - txn parameter can be used in this callback. The + txn parameter, can be used in this callback. The parameters prepare_end_lsn and prepare_time can be used to check if the plugin - has received this prepare transaction in which case it can apply the + has received this PREPARE TRANSACTION in which case it can apply the rollback, otherwise, it can skip the rollback operation. The gid alone is not sufficient because the downstream - node can have prepared transaction with same identifier. + node can have a prepared transaction with same identifier. typedef void (*LogicalDecodeRollbackPreparedCB) (struct LogicalDecodingContext *ctx, ReorderBufferTXN *txn, @@ -1122,7 +1122,7 @@ OutputPluginWrite(ctx, true); the stream_commit_cb callback (or possibly aborted using the stream_abort_cb callback). If two-phase commits are supported, the transaction can be prepared using the - stream_prepare_cb callback, commit prepared using the + stream_prepare_cb callback, COMMIT PREPARED using the commit_prepared_cb callback or aborted using the rollback_prepared_cb. -- 2.17.0