From 565889ffb15ed73ec752f044b38bd0ce19e31a35 Mon Sep 17 00:00:00 2001 From: Petr Jelinek Date: Sun, 19 Oct 2014 00:15:47 +0200 Subject: [PATCH] bdr: Add some explanatory comments. --- bdr_apply.c | 4 ++++ bdr_output.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bdr_apply.c b/bdr_apply.c index 182a4234a9..5260e397bb 100644 --- a/bdr_apply.c +++ b/bdr_apply.c @@ -339,6 +339,10 @@ process_remote_commit(StringInfo s) */ AdvanceCachedReplicationIdentifier(end_lsn, XactLastCommitEnd); + /* + * Catchup mode is not supported in UDR, because we can't sent origin_id + * in 9.4. + */ #ifdef BUILDING_BDR /* * If we're in catchup mode, see if the commit is relayed from elsewhere diff --git a/bdr_output.c b/bdr_output.c index e8c5c503e8..e9dff98d8e 100644 --- a/bdr_output.c +++ b/bdr_output.c @@ -641,9 +641,7 @@ should_forward_change(LogicalDecodingContext *ctx, BdrOutputData *data, void pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) { -#ifdef BUILDING_BDR BdrOutputData *data = ctx->output_plugin_private; -#endif int flags = 0; AssertVariableIsOfType(&pg_decode_begin_txn, LogicalDecodeBeginCB); @@ -654,10 +652,18 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn) OutputPluginPrepareWrite(ctx, true); pq_sendbyte(ctx->out, 'B'); /* BEGIN */ + /* + * Vanialla Postgres does not provide origin id so UDR + * can't set transaction origin (same applies to the other + * ifdef in this function). + */ #ifdef BUILDING_BDR /* * Are we forwarding changesets from other nodes? If so, we must include * the origin node ID and LSN in BEGIN records. + * + * Note: the 9.4 does not provide origin_id so we don't support + * forwarded changesets in UDR yet. */ if (data->forward_changesets) flags |= BDR_OUTPUT_TRANSACTION_HAS_ORIGIN; -- 2.39.5