bdr: Also setup pid/pgproc entries in the output plugins shmem slot.
authorAndres Freund <andres@anarazel.de>
Mon, 9 Feb 2015 02:40:37 +0000 (03:40 +0100)
committerAndres Freund <andres@anarazel.de>
Thu, 12 Feb 2015 09:16:59 +0000 (10:16 +0100)
bdr_output.c

index ad11c8374853e2ba8a0f563e7d33b828e98f953f..fb45642e187a1479c4f0414b8c04af89f052e6d6 100644 (file)
@@ -44,6 +44,8 @@
 #include "replication/slot.h"
 #include "replication/walsender_private.h"
 
+#include "storage/proc.h"
+
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
@@ -650,6 +652,8 @@ pg_decode_startup(LogicalDecodingContext * ctx, OutputPluginOptions *opt, bool i
        LWLockAcquire(BdrWorkerCtl->lock, LW_EXCLUSIVE);
        bdr_worker_shmem_alloc(BDR_WORKER_WALSENDER, &worker_idx);
        bdr_worker_shmem_acquire(BDR_WORKER_WALSENDER, worker_idx, true);
+       bdr_worker_slot->worker_pid = MyProcPid;
+       bdr_worker_slot->worker_proc = MyProc;
        /* can be null if sql interface is used */
        bdr_worker_slot->data.walsnd.walsender = MyWalSnd;
        bdr_worker_slot->data.walsnd.slot = MyReplicationSlot;