diff options
| author | Simon Riggs <simon@2ndQuadrant.com> | 2017-05-12 10:50:56 +0100 |
|---|---|---|
| committer | Simon Riggs <simon@2ndQuadrant.com> | 2017-05-12 10:50:56 +0100 |
| commit | 024711bb544645c8b1061e9f02b261e2e336981d (patch) | |
| tree | 8c0a7b85c0260c260ddd6cb89cd4ee578b56ab12 /src/include | |
| parent | efa2c18f4e8a8ccc74d9005d960f4c1a2bf05ea9 (diff) | |
Lag tracking for logical replication
Lag tracking is called for each commit, but we introduce
a pacing delay to ensure we don't swamp the lag tracker.
Author: Petr Jelinek, with minor pacing delay code from me
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/replication/logical.h | 15 | ||||
| -rw-r--r-- | src/include/replication/output_plugin.h | 1 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/include/replication/logical.h b/src/include/replication/logical.h index d0b2e0bbaef..090f9c82680 100644 --- a/src/include/replication/logical.h +++ b/src/include/replication/logical.h @@ -26,6 +26,12 @@ typedef void (*LogicalOutputPluginWriterWrite) ( typedef LogicalOutputPluginWriterWrite LogicalOutputPluginWriterPrepareWrite; +typedef void (*LogicalOutputPluginWriterUpdateProgress) ( + struct LogicalDecodingContext *lr, + XLogRecPtr Ptr, + TransactionId xid +); + typedef struct LogicalDecodingContext { /* memory context this is all allocated in */ @@ -52,6 +58,7 @@ typedef struct LogicalDecodingContext */ LogicalOutputPluginWriterPrepareWrite prepare_write; LogicalOutputPluginWriterWrite write; + LogicalOutputPluginWriterUpdateProgress update_progress; /* * Output buffer. @@ -85,13 +92,15 @@ extern LogicalDecodingContext *CreateInitDecodingContext(char *plugin, bool need_full_snapshot, XLogPageReadCB read_page, LogicalOutputPluginWriterPrepareWrite prepare_write, - LogicalOutputPluginWriterWrite do_write); + LogicalOutputPluginWriterWrite do_write, + LogicalOutputPluginWriterUpdateProgress update_progress); extern LogicalDecodingContext *CreateDecodingContext( XLogRecPtr start_lsn, List *output_plugin_options, XLogPageReadCB read_page, LogicalOutputPluginWriterPrepareWrite prepare_write, - LogicalOutputPluginWriterWrite do_write); + LogicalOutputPluginWriterWrite do_write, + LogicalOutputPluginWriterUpdateProgress update_progress); extern void DecodingContextFindStartpoint(LogicalDecodingContext *ctx); extern bool DecodingContextReady(LogicalDecodingContext *ctx); extern void FreeDecodingContext(LogicalDecodingContext *ctx); @@ -101,8 +110,6 @@ extern void LogicalIncreaseRestartDecodingForSlot(XLogRecPtr current_lsn, XLogRecPtr restart_lsn); extern void LogicalConfirmReceivedLocation(XLogRecPtr lsn); -extern void LagTrackerWrite(XLogRecPtr lsn, TimestampTz local_flush_time); - extern bool filter_by_origin_cb_wrapper(LogicalDecodingContext *ctx, RepOriginId origin_id); #endif diff --git a/src/include/replication/output_plugin.h b/src/include/replication/output_plugin.h index 08e962d0c0c..2435e2be2d2 100644 --- a/src/include/replication/output_plugin.h +++ b/src/include/replication/output_plugin.h @@ -106,5 +106,6 @@ typedef struct 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); #endif /* OUTPUT_PLUGIN_H */ |
