diff options
author | Amit Kapila <akapila@postgresql.org> | 2021-03-30 10:34:43 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2021-03-30 10:34:43 +0530 |
commit | f64ea6dc5c8ccaec9a3d3d39695ca261febb6883 (patch) | |
tree | 6fd006f6239df0b955d390f27189ffbd68b8df05 /src/backend/replication/logical/logical.c | |
parent | bc2797ebb14bae663da1ee7845774dd98716c0d0 (diff) | |
download | postgresql-f64ea6dc5c8ccaec9a3d3d39695ca261febb6883.tar.gz postgresql-f64ea6dc5c8ccaec9a3d3d39695ca261febb6883.zip |
Add a xid argument to the filter_prepare callback for output plugins.
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
Diffstat (limited to 'src/backend/replication/logical/logical.c')
-rw-r--r-- | src/backend/replication/logical/logical.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |