On 12/7/17 08:31, Peter Eisentraut wrote:
> On 12/4/17 10:15, Nikhil Sontakke wrote:
>> PFA, latest patch for this functionality.
> 
> This probably needs documentation updates for the logical decoding chapter.

You need the attached patch to be able to compile without warnings.

Also, the regression tests crash randomly for me at

frame #4: 0x000000010a6febdb
postgres`heap_prune_record_prunable(prstate=0x00007ffee5578990, xid=0)
at pruneheap.c:625
   622           * This should exactly match the PageSetPrunable macro.  We
can't store
   623           * directly into the page header yet, so we update working 
state.
   624           */
-> 625          Assert(TransactionIdIsNormal(xid));
   626          if (!TransactionIdIsValid(prstate->new_prune_xid) ||
   627                  TransactionIdPrecedes(xid, prstate->new_prune_xid))
   628                  prstate->new_prune_xid = xid;

Did you build with --enable-cassert?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From 0beddc4b47d160d4fcd9e99d23a90c4273b32c41 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pete...@gmx.net>
Date: Thu, 7 Dec 2017 14:42:04 -0500
Subject: [PATCH] fixup! Original patch

---
 contrib/test_decoding/test_decoding.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/test_decoding/test_decoding.c 
b/contrib/test_decoding/test_decoding.c
index 362683feef..a709e2ff92 100644
--- a/contrib/test_decoding/test_decoding.c
+++ b/contrib/test_decoding/test_decoding.c
@@ -74,7 +74,7 @@ static void pg_decode_message(LogicalDecodingContext *ctx,
                                  Size sz, const char *message);
 static bool pg_filter_prepare(LogicalDecodingContext *ctx,
                                  ReorderBufferTXN *txn,
-                                 char *gid);
+                                 const char *gid);
 static void pg_decode_prepare_txn(LogicalDecodingContext *ctx,
                                  ReorderBufferTXN *txn,
                                  XLogRecPtr prepare_lsn);
@@ -290,7 +290,7 @@ pg_decode_commit_txn(LogicalDecodingContext *ctx, 
ReorderBufferTXN *txn,
 /* Filter out unnecessary two-phase transactions */
 static bool
 pg_filter_prepare(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-                                       char *gid)
+                                       const char *gid)
 {
        TestDecodingData *data = ctx->output_plugin_private;
 
-- 
2.15.1

Reply via email to