1/*-------------------------------------------------------------------------
3 * PostgreSQL logical decoding coordination
5 * Copyright (c) 2012-2025, PostgreSQL Global Development Group
7 *-------------------------------------------------------------------------
35 /* memory context this is all allocated in */
38 /* The associated replication slot */
41 /* infrastructure pieces for decoding */
47 * Marks the logical decoding context as fast forward decoding one. Such a
48 * context does not have plugin loaded so most of the following properties
57 * User specified options
62 * User-Provided callback for writing/streaming out data.
74 * Private data pointer of the output plugin.
79 * Private data pointer for the data writer.
84 * Does the output plugin support streaming, and is it enabled?
89 * Does the output plugin support two-phase decoding, and is it enabled?
94 * Is two-phase option given by output plugin?
96 * This flag indicates that the plugin passed in the two-phase option as
97 * part of the START_STREAMING command. We can't rely solely on the
98 * twophase flag which only tells whether the plugin provided all the
99 * necessary two-phase callbacks.
104 * State for writing output.
110 /* Are we processing the end LSN of a transaction? */
113 /* Do we need to process any change in fast_forward mode? */
121 List *output_plugin_options,
122 bool need_full_snapshot,
129 List *output_plugin_options,
153 bool *found_consistent_snapshot);
void(* LogicalOutputPluginWriterUpdateProgress)(struct LogicalDecodingContext *lr, XLogRecPtr Ptr, TransactionId xid, bool skipped_xact)
XLogRecPtr LogicalSlotAdvanceAndCheckSnapState(XLogRecPtr moveto, bool *found_consistent_snapshot)
void LogicalConfirmReceivedLocation(XLogRecPtr lsn)
void FreeDecodingContext(LogicalDecodingContext *ctx)
bool LogicalReplicationSlotHasPendingWal(XLogRecPtr end_of_wal)
struct LogicalDecodingContext LogicalDecodingContext
LogicalDecodingContext * CreateDecodingContext(XLogRecPtr start_lsn, List *output_plugin_options, bool fast_forward, XLogReaderRoutine *xl_routine, LogicalOutputPluginWriterPrepareWrite prepare_write, LogicalOutputPluginWriterWrite do_write, LogicalOutputPluginWriterUpdateProgress update_progress)
void(* LogicalOutputPluginWriterWrite)(struct LogicalDecodingContext *lr, XLogRecPtr Ptr, TransactionId xid, bool last_write)
void DecodingContextFindStartpoint(LogicalDecodingContext *ctx)
bool DecodingContextReady(LogicalDecodingContext *ctx)
LogicalDecodingContext * CreateInitDecodingContext(const char *plugin, List *output_plugin_options, bool need_full_snapshot, XLogRecPtr restart_lsn, XLogReaderRoutine *xl_routine, LogicalOutputPluginWriterPrepareWrite prepare_write, LogicalOutputPluginWriterWrite do_write, LogicalOutputPluginWriterUpdateProgress update_progress)
void UpdateDecodingStats(LogicalDecodingContext *ctx)
void LogicalIncreaseRestartDecodingForSlot(XLogRecPtr current_lsn, XLogRecPtr restart_lsn)
LogicalOutputPluginWriterWrite LogicalOutputPluginWriterPrepareWrite
void ResetLogicalStreamingState(void)
void LogicalIncreaseXminForSlot(XLogRecPtr current_lsn, TransactionId xmin)
bool filter_prepare_cb_wrapper(LogicalDecodingContext *ctx, TransactionId xid, const char *gid)
void CheckLogicalDecodingRequirements(void)
bool filter_by_origin_cb_wrapper(LogicalDecodingContext *ctx, RepOriginId origin_id)
static const char * plugin
OutputPluginOptions options
struct SnapBuild * snapshot_builder
void * output_writer_private
XLogRecPtr write_location
LogicalOutputPluginWriterPrepareWrite prepare_write
OutputPluginCallbacks callbacks
void * output_plugin_private
List * output_plugin_options
LogicalOutputPluginWriterWrite write
struct ReorderBuffer * reorder
LogicalOutputPluginWriterUpdateProgress update_progress