From f64ea6dc5c8ccaec9a3d3d39695ca261febb6883 Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Tue, 30 Mar 2021 10:34:43 +0530 Subject: Add a xid argument to the filter_prepare callback for output plugins. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Along with gid, this provides a different way to identify the transaction. The users that use xid in some way to prepare the transactions can use it to filter prepare transactions. The later commands COMMIT PREPARED or ROLLBACK PREPARED carries both identifiers, providing an output plugin the choice of what to use. Author: Markus Wanner Reviewed-by: Vignesh C, Amit Kapila Discussion: https://postgr.es/m/ee280000-7355-c4dc-e47b-2436e7be959c@enterprisedb.com --- src/backend/replication/logical/logical.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/backend/replication/logical/logical.c') diff --git a/src/backend/replication/logical/logical.c b/src/backend/replication/logical/logical.c index 37b75deb728..2f6803637bf 100644 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@ -1083,7 +1083,8 @@ truncate_cb_wrapper(ReorderBuffer *cache, ReorderBufferTXN *txn, } bool -filter_prepare_cb_wrapper(LogicalDecodingContext *ctx, const char *gid) +filter_prepare_cb_wrapper(LogicalDecodingContext *ctx, TransactionId xid, + const char *gid) { LogicalErrorCallbackState state; ErrorContextCallback errcallback; @@ -1104,7 +1105,7 @@ filter_prepare_cb_wrapper(LogicalDecodingContext *ctx, const char *gid) ctx->accept_writes = false; /* do the actual work: call callback */ - ret = ctx->callbacks.filter_prepare_cb(ctx, gid); + ret = ctx->callbacks.filter_prepare_cb(ctx, xid, gid); /* Pop the error context stack */ error_context_stack = errcallback.previous; -- cgit v1.2.3