MCPcopy Create free account
hub / github.com/apache/cloudberry / pg_decode_stream_abort

Function pg_decode_stream_abort

contrib/test_decoding/test_decoding.c:800–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798}
799
800static void
801pg_decode_stream_abort(LogicalDecodingContext *ctx,
802 ReorderBufferTXN *txn,
803 XLogRecPtr abort_lsn)
804{
805 TestDecodingData *data = ctx->output_plugin_private;
806
807 /*
808 * stream abort can be sent for an individual subtransaction but we
809 * maintain the output_plugin_private only under the toptxn so if this is
810 * not the toptxn then fetch the toptxn.
811 */
812 ReorderBufferTXN *toptxn = txn->toptxn ? txn->toptxn : txn;
813 TestDecodingTxnData *txndata = toptxn->output_plugin_private;
814 bool xact_wrote_changes = txndata->xact_wrote_changes;
815
816 if (txn->toptxn == NULL)
817 {
818 Assert(txn->output_plugin_private != NULL);
819 pfree(txndata);
820 txn->output_plugin_private = NULL;
821 }
822
823 if (data->skip_empty_xacts && !xact_wrote_changes)
824 return;
825
826 OutputPluginPrepareWrite(ctx, true);
827 if (data->include_xids)
828 appendStringInfo(ctx->out, "aborting streamed (sub)transaction TXN %u", txn->xid);
829 else
830 appendStringInfoString(ctx->out, "aborting streamed (sub)transaction");
831 OutputPluginWrite(ctx, true);
832}
833
834static void
835pg_decode_stream_prepare(LogicalDecodingContext *ctx,

Callers

nothing calls this directly

Calls 5

OutputPluginPrepareWriteFunction · 0.85
appendStringInfoFunction · 0.85
appendStringInfoStringFunction · 0.85
OutputPluginWriteFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected