From 108a867c425deeeeb5bf10b8813e6fd1b5d9cdac Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Wed, 1 Mar 2023 17:52:38 +1100 Subject: [PATCH v1] Use typedef struct LogicalDecodingContext Make better use of the pre-declared typed struct so that function prototypes using LogicalDecodingContext no longer need to say 'struct LogicalDecodingContext'. --- doc/src/sgml/custom-rmgr.sgml | 2 +- doc/src/sgml/logicaldecoding.sgml | 42 ++++++++++++------------ src/backend/replication/logical/logical.c | 6 ++-- src/backend/replication/pgoutput/pgoutput.c | 16 ++++----- src/include/access/xlog_internal.h | 4 +-- src/include/replication/logical.h | 10 +++--- src/include/replication/output_plugin.h | 50 ++++++++++++++--------------- 7 files changed, 65 insertions(+), 65 deletions(-) diff --git a/doc/src/sgml/custom-rmgr.sgml b/doc/src/sgml/custom-rmgr.sgml index baf86b1..353777a 100644 --- a/doc/src/sgml/custom-rmgr.sgml +++ b/doc/src/sgml/custom-rmgr.sgml @@ -52,7 +52,7 @@ typedef struct RmgrData void (*rm_startup) (void); void (*rm_cleanup) (void); void (*rm_mask) (char *pagedata, BlockNumber blkno); - void (*rm_decode) (struct LogicalDecodingContext *ctx, + void (*rm_decode) (LogicalDecodingContext *ctx, struct XLogRecordBuffer *buf); } RmgrData; diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml index 4e912b4..8e0ee00 100644 --- a/doc/src/sgml/logicaldecoding.sgml +++ b/doc/src/sgml/logicaldecoding.sgml @@ -597,7 +597,7 @@ CREATE TABLE another_catalog_table(data text) WITH (user_catalog_table = true); a replication slot is created or asked to stream changes, independent of the number of changes that are ready to be put out. -typedef void (*LogicalDecodeStartupCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStartupCB) (LogicalDecodingContext *ctx, OutputPluginOptions *options, bool is_init); @@ -639,7 +639,7 @@ typedef struct OutputPluginOptions be used to deallocate resources private to the output plugin. The slot isn't necessarily being dropped, streaming is just being stopped. -typedef void (*LogicalDecodeShutdownCB) (struct LogicalDecodingContext *ctx); +typedef void (*LogicalDecodeShutdownCB) (LogicalDecodingContext *ctx); @@ -652,7 +652,7 @@ typedef void (*LogicalDecodeShutdownCB) (struct LogicalDecodingContext *ctx); start of a committed transaction has been decoded. Aborted transactions and their contents never get decoded. -typedef void (*LogicalDecodeBeginCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeBeginCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn); The txn parameter contains meta information about @@ -671,7 +671,7 @@ typedef void (*LogicalDecodeBeginCB) (struct LogicalDecodingContext *ctx, rows will have been called before this, if there have been any modified rows. -typedef void (*LogicalDecodeCommitCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeCommitCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr commit_lsn); @@ -695,7 +695,7 @@ typedef void (*LogicalDecodeCommitCB) (struct LogicalDecodingContext *ctx, this very same transaction. In that case, the logical decoding of this aborted transaction is stopped gracefully. -typedef void (*LogicalDecodeChangeCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeChangeCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change); @@ -726,7 +726,7 @@ typedef void (*LogicalDecodeChangeCB) (struct LogicalDecodingContext *ctx, The optional truncate_cb callback is called for a TRUNCATE command. -typedef void (*LogicalDecodeTruncateCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeTruncateCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, int nrelations, Relation relations[], @@ -750,7 +750,7 @@ typedef void (*LogicalDecodeTruncateCB) (struct LogicalDecodingContext *ctx, from origin_id is of interest to the output plugin. -typedef bool (*LogicalDecodeFilterByOriginCB) (struct LogicalDecodingContext *ctx, +typedef bool (*LogicalDecodeFilterByOriginCB) (LogicalDecodingContext *ctx, RepOriginId origin_id); The ctx parameter has the same contents @@ -777,7 +777,7 @@ typedef bool (*LogicalDecodeFilterByOriginCB) (struct LogicalDecodingContext *ct The optional message_cb callback is called whenever a logical decoding message has been decoded. -typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeMessageCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr message_lsn, bool transactional, @@ -824,7 +824,7 @@ typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx, defined, false is assumed (i.e. no filtering, all transactions using two-phase commit are decoded in two phases as well). -typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx, +typedef bool (*LogicalDecodeFilterPrepareCB) (LogicalDecodingContext *ctx, TransactionId xid, const char *gid); @@ -855,7 +855,7 @@ typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx in which case it can either error out or skip the remaining changes of the transaction. -typedef void (*LogicalDecodeBeginPrepareCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeBeginPrepareCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn); @@ -872,7 +872,7 @@ typedef void (*LogicalDecodeBeginPrepareCB) (struct LogicalDecodingContext *ctx, rows. The gid field, which is part of the txn parameter, can be used in this callback. -typedef void (*LogicalDecodePrepareCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodePrepareCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr prepare_lsn); @@ -888,7 +888,7 @@ typedef void (*LogicalDecodePrepareCB) (struct LogicalDecodingContext *ctx, The gid field, which is part of the txn parameter, can be used in this callback. -typedef void (*LogicalDecodeCommitPreparedCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeCommitPreparedCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr commit_lsn); @@ -910,7 +910,7 @@ typedef void (*LogicalDecodeCommitPreparedCB) (struct LogicalDecodingContext *ct gid alone is not sufficient because the downstream node can have a prepared transaction with same identifier. -typedef void (*LogicalDecodeRollbackPreparedCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeRollbackPreparedCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr prepare_end_lsn, TimestampTz prepare_time); @@ -924,7 +924,7 @@ typedef void (*LogicalDecodeRollbackPreparedCB) (struct LogicalDecodingContext * The required stream_start_cb callback is called when opening a block of streamed changes from an in-progress transaction. -typedef void (*LogicalDecodeStreamStartCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamStartCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn); @@ -936,7 +936,7 @@ typedef void (*LogicalDecodeStreamStartCB) (struct LogicalDecodingContext *ctx, The required stream_stop_cb callback is called when closing a block of streamed changes from an in-progress transaction. -typedef void (*LogicalDecodeStreamStopCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamStopCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn); @@ -948,7 +948,7 @@ typedef void (*LogicalDecodeStreamStopCB) (struct LogicalDecodingContext *ctx, The required stream_abort_cb callback is called to abort a previously streamed transaction. -typedef void (*LogicalDecodeStreamAbortCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamAbortCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr abort_lsn); @@ -963,7 +963,7 @@ typedef void (*LogicalDecodeStreamAbortCB) (struct LogicalDecodingContext *ctx, callback is required when the output plugin supports both the streaming of large in-progress transactions and two-phase commits. -typedef void (*LogicalDecodeStreamPrepareCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamPrepareCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr prepare_lsn); @@ -976,7 +976,7 @@ typedef void (*LogicalDecodeStreamPrepareCB) (struct LogicalDecodingContext *ctx The required stream_commit_cb callback is called to commit a previously streamed transaction. -typedef void (*LogicalDecodeStreamCommitCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamCommitCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr commit_lsn); @@ -992,7 +992,7 @@ typedef void (*LogicalDecodeStreamCommitCB) (struct LogicalDecodingContext *ctx, The actual changes are not displayed as the transaction can abort at a later point in time and we don't decode changes for aborted transactions. -typedef void (*LogicalDecodeStreamChangeCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamChangeCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change); @@ -1010,7 +1010,7 @@ typedef void (*LogicalDecodeStreamChangeCB) (struct LogicalDecodingContext *ctx, can abort at a later point in time and we don't decode changes for aborted transactions. -typedef void (*LogicalDecodeStreamMessageCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamMessageCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr message_lsn, bool transactional, @@ -1029,7 +1029,7 @@ typedef void (*LogicalDecodeStreamMessageCB) (struct LogicalDecodingContext *ctx (demarcated by stream_start_cb and stream_stop_cb calls). -typedef void (*LogicalDecodeStreamTruncateCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamTruncateCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, int nrelations, Relation relations[], diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index c3ec97a..88de062 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -659,7 +659,7 @@ FreeDecodingContext(LogicalDecodingContext *ctx) * Prepare a write using the context's output routine. */ void -OutputPluginPrepareWrite(struct LogicalDecodingContext *ctx, bool last_write) +OutputPluginPrepareWrite(LogicalDecodingContext *ctx, bool last_write) { if (!ctx->accept_writes) elog(ERROR, "writes are only accepted in commit, begin and change callbacks"); @@ -672,7 +672,7 @@ OutputPluginPrepareWrite(struct LogicalDecodingContext *ctx, bool last_write) * Perform a write using the context's output routine. */ void -OutputPluginWrite(struct LogicalDecodingContext *ctx, bool last_write) +OutputPluginWrite(LogicalDecodingContext *ctx, bool last_write) { if (!ctx->prepared_write) elog(ERROR, "OutputPluginPrepareWrite needs to be called before OutputPluginWrite"); @@ -685,7 +685,7 @@ OutputPluginWrite(struct LogicalDecodingContext *ctx, bool last_write) * Update progress tracking (if supported). */ void -OutputPluginUpdateProgress(struct LogicalDecodingContext *ctx, +OutputPluginUpdateProgress(LogicalDecodingContext *ctx, bool skipped_xact) { if (!ctx->update_progress) diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c index 0df1acb..f09f643 100644 --- a/src/backend/replication/pgoutput/pgoutput.c +++ b/src/backend/replication/pgoutput/pgoutput.c @@ -66,14 +66,14 @@ static void pgoutput_rollback_prepared_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr prepare_end_lsn, TimestampTz prepare_time); -static void pgoutput_stream_start(struct LogicalDecodingContext *ctx, +static void pgoutput_stream_start(LogicalDecodingContext *ctx, ReorderBufferTXN *txn); -static void pgoutput_stream_stop(struct LogicalDecodingContext *ctx, +static void pgoutput_stream_stop(LogicalDecodingContext *ctx, ReorderBufferTXN *txn); -static void pgoutput_stream_abort(struct LogicalDecodingContext *ctx, +static void pgoutput_stream_abort(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr abort_lsn); -static void pgoutput_stream_commit(struct LogicalDecodingContext *ctx, +static void pgoutput_stream_commit(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr commit_lsn); static void pgoutput_stream_prepare_txn(LogicalDecodingContext *ctx, @@ -1809,7 +1809,7 @@ publication_invalidation_cb(Datum arg, int cacheid, uint32 hashvalue) * START STREAM callback */ static void -pgoutput_stream_start(struct LogicalDecodingContext *ctx, +pgoutput_stream_start(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) { bool send_replication_origin = txn->origin_id != InvalidRepOriginId; @@ -1840,7 +1840,7 @@ pgoutput_stream_start(struct LogicalDecodingContext *ctx, * STOP STREAM callback */ static void -pgoutput_stream_stop(struct LogicalDecodingContext *ctx, +pgoutput_stream_stop(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) { /* we should be streaming a trasanction */ @@ -1859,7 +1859,7 @@ pgoutput_stream_stop(struct LogicalDecodingContext *ctx, * it's subtransactions, if it's a toplevel transaction). */ static void -pgoutput_stream_abort(struct LogicalDecodingContext *ctx, +pgoutput_stream_abort(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr abort_lsn) { @@ -1892,7 +1892,7 @@ pgoutput_stream_abort(struct LogicalDecodingContext *ctx, * it's subtransactions). */ static void -pgoutput_stream_commit(struct LogicalDecodingContext *ctx, +pgoutput_stream_commit(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr commit_lsn) { diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index 8edae7b..a9dbf32 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -325,7 +325,7 @@ typedef enum RECOVERY_TARGET_ACTION_SHUTDOWN } RecoveryTargetAction; -struct LogicalDecodingContext; +typedef struct LogicalDecodingContext LogicalDecodingContext; struct XLogRecordBuffer; /* @@ -354,7 +354,7 @@ typedef struct RmgrData void (*rm_startup) (void); void (*rm_cleanup) (void); void (*rm_mask) (char *pagedata, BlockNumber blkno); - void (*rm_decode) (struct LogicalDecodingContext *ctx, + void (*rm_decode) (LogicalDecodingContext *ctx, struct XLogRecordBuffer *buf); } RmgrData; diff --git a/src/include/replication/logical.h b/src/include/replication/logical.h index 5f49554..279bb6f 100644 --- a/src/include/replication/logical.h +++ b/src/include/replication/logical.h @@ -14,9 +14,9 @@ #include "replication/output_plugin.h" #include "replication/slot.h" -struct LogicalDecodingContext; +typedef struct LogicalDecodingContext LogicalDecodingContext; -typedef void (*LogicalOutputPluginWriterWrite) (struct LogicalDecodingContext *lr, +typedef void (*LogicalOutputPluginWriterWrite) (LogicalDecodingContext *lr, XLogRecPtr Ptr, TransactionId xid, bool last_write @@ -24,13 +24,13 @@ typedef void (*LogicalOutputPluginWriterWrite) (struct LogicalDecodingContext *l typedef LogicalOutputPluginWriterWrite LogicalOutputPluginWriterPrepareWrite; -typedef void (*LogicalOutputPluginWriterUpdateProgress) (struct LogicalDecodingContext *lr, +typedef void (*LogicalOutputPluginWriterUpdateProgress) (LogicalDecodingContext *lr, XLogRecPtr Ptr, TransactionId xid, bool skipped_xact ); -typedef struct LogicalDecodingContext +struct LogicalDecodingContext { /* memory context this is all allocated in */ MemoryContext context; @@ -109,7 +109,7 @@ typedef struct LogicalDecodingContext TransactionId write_xid; /* Are we processing the end LSN of a transaction? */ bool end_xact; -} LogicalDecodingContext; +}; extern void CheckLogicalDecodingRequirements(void); diff --git a/src/include/replication/output_plugin.h b/src/include/replication/output_plugin.h index 2d89d26..6772935 100644 --- a/src/include/replication/output_plugin.h +++ b/src/include/replication/output_plugin.h @@ -11,7 +11,7 @@ #include "replication/reorderbuffer.h" -struct LogicalDecodingContext; +typedef struct LogicalDecodingContext LogicalDecodingContext; struct OutputPluginCallbacks; typedef enum OutputPluginOutputType @@ -44,7 +44,7 @@ extern PGDLLEXPORT void _PG_output_plugin_init(struct OutputPluginCallbacks *cb) * "is_init" will be set to "true" if the decoding slot just got defined. When * the same slot is used from there one, it will be "false". */ -typedef void (*LogicalDecodeStartupCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStartupCB) (LogicalDecodingContext *ctx, OutputPluginOptions *options, bool is_init); @@ -52,13 +52,13 @@ typedef void (*LogicalDecodeStartupCB) (struct LogicalDecodingContext *ctx, * Callback called for every (explicit or implicit) BEGIN of a successful * transaction. */ -typedef void (*LogicalDecodeBeginCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeBeginCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn); /* * Callback for every individual change in a successful transaction. */ -typedef void (*LogicalDecodeChangeCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeChangeCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change); @@ -66,7 +66,7 @@ typedef void (*LogicalDecodeChangeCB) (struct LogicalDecodingContext *ctx, /* * Callback for every TRUNCATE in a successful transaction. */ -typedef void (*LogicalDecodeTruncateCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeTruncateCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, int nrelations, Relation relations[], @@ -75,14 +75,14 @@ typedef void (*LogicalDecodeTruncateCB) (struct LogicalDecodingContext *ctx, /* * Called for every (explicit or implicit) COMMIT of a successful transaction. */ -typedef void (*LogicalDecodeCommitCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeCommitCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr commit_lsn); /* * Called for the generic logical decoding messages. */ -typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeMessageCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr message_lsn, bool transactional, @@ -93,13 +93,13 @@ typedef void (*LogicalDecodeMessageCB) (struct LogicalDecodingContext *ctx, /* * Filter changes by origin. */ -typedef bool (*LogicalDecodeFilterByOriginCB) (struct LogicalDecodingContext *ctx, +typedef bool (*LogicalDecodeFilterByOriginCB) (LogicalDecodingContext *ctx, RepOriginId origin_id); /* * Called to shutdown an output plugin. */ -typedef void (*LogicalDecodeShutdownCB) (struct LogicalDecodingContext *ctx); +typedef void (*LogicalDecodeShutdownCB) (LogicalDecodingContext *ctx); /* * Called before decoding of PREPARE record to decide whether this @@ -107,35 +107,35 @@ typedef void (*LogicalDecodeShutdownCB) (struct LogicalDecodingContext *ctx); * commit_prepared/rollback_prepared callbacks or wait till COMMIT PREPARED * and sent as usual transaction. */ -typedef bool (*LogicalDecodeFilterPrepareCB) (struct LogicalDecodingContext *ctx, +typedef bool (*LogicalDecodeFilterPrepareCB) (LogicalDecodingContext *ctx, TransactionId xid, const char *gid); /* * Callback called for every BEGIN of a prepared trnsaction. */ -typedef void (*LogicalDecodeBeginPrepareCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeBeginPrepareCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn); /* * Called for PREPARE record unless it was filtered by filter_prepare() * callback. */ -typedef void (*LogicalDecodePrepareCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodePrepareCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr prepare_lsn); /* * Called for COMMIT PREPARED. */ -typedef void (*LogicalDecodeCommitPreparedCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeCommitPreparedCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr commit_lsn); /* * Called for ROLLBACK PREPARED. */ -typedef void (*LogicalDecodeRollbackPreparedCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeRollbackPreparedCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr prepare_end_lsn, TimestampTz prepare_time); @@ -146,7 +146,7 @@ typedef void (*LogicalDecodeRollbackPreparedCB) (struct LogicalDecodingContext * * transaction (may be called repeatedly, if it's streamed in multiple * chunks). */ -typedef void (*LogicalDecodeStreamStartCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamStartCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn); /* @@ -154,14 +154,14 @@ typedef void (*LogicalDecodeStreamStartCB) (struct LogicalDecodingContext *ctx, * transaction to a remote node (may be called repeatedly, if it's streamed * in multiple chunks). */ -typedef void (*LogicalDecodeStreamStopCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamStopCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn); /* * Called to discard changes streamed to remote node from in-progress * transaction. */ -typedef void (*LogicalDecodeStreamAbortCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamAbortCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr abort_lsn); @@ -169,7 +169,7 @@ typedef void (*LogicalDecodeStreamAbortCB) (struct LogicalDecodingContext *ctx, * Called to prepare changes streamed to remote node from in-progress * transaction. This is called as part of a two-phase commit. */ -typedef void (*LogicalDecodeStreamPrepareCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamPrepareCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr prepare_lsn); @@ -177,14 +177,14 @@ typedef void (*LogicalDecodeStreamPrepareCB) (struct LogicalDecodingContext *ctx * Called to apply changes streamed to remote node from in-progress * transaction. */ -typedef void (*LogicalDecodeStreamCommitCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamCommitCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr commit_lsn); /* * Callback for streaming individual changes from in-progress transactions. */ -typedef void (*LogicalDecodeStreamChangeCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamChangeCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Relation relation, ReorderBufferChange *change); @@ -193,7 +193,7 @@ typedef void (*LogicalDecodeStreamChangeCB) (struct LogicalDecodingContext *ctx, * Callback for streaming generic logical decoding messages from in-progress * transactions. */ -typedef void (*LogicalDecodeStreamMessageCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamMessageCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, XLogRecPtr message_lsn, bool transactional, @@ -204,7 +204,7 @@ typedef void (*LogicalDecodeStreamMessageCB) (struct LogicalDecodingContext *ctx /* * Callback for streaming truncates from in-progress transactions. */ -typedef void (*LogicalDecodeStreamTruncateCB) (struct LogicalDecodingContext *ctx, +typedef void (*LogicalDecodeStreamTruncateCB) (LogicalDecodingContext *ctx, ReorderBufferTXN *txn, int nrelations, Relation relations[], @@ -243,8 +243,8 @@ typedef struct OutputPluginCallbacks } OutputPluginCallbacks; /* Functions in replication/logical/logical.c */ -extern void OutputPluginPrepareWrite(struct LogicalDecodingContext *ctx, bool last_write); -extern void OutputPluginWrite(struct LogicalDecodingContext *ctx, bool last_write); -extern void OutputPluginUpdateProgress(struct LogicalDecodingContext *ctx, bool skipped_xact); +extern void OutputPluginPrepareWrite(LogicalDecodingContext *ctx, bool last_write); +extern void OutputPluginWrite(LogicalDecodingContext *ctx, bool last_write); +extern void OutputPluginUpdateProgress(LogicalDecodingContext *ctx, bool skipped_xact); #endif /* OUTPUT_PLUGIN_H */ -- 1.8.3.1