pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Nikhil Sontakke <nikhils@2ndquadrant.com>
To: Craig Ringer <craig@2ndquadrant.com>
Cc: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Cc: Sokolov Yura <y.sokolov@postgrespro.ru>
Cc: Stas Kelvich <s.kelvich@postgrespro.ru>
Cc: Andres Freund <andres@anarazel.de>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Date: Thu, 7 Dec 2017 14:45:53 -0500
Message-ID: <f351fc25-7b4d-3bf3-0398-d8a55bb3bd87@2ndquadrant.com> (raw)
In-Reply-To: <45525c30-4002-861e-a82c-3b95b19d1514@2ndquadrant.com>
References: <A434797D-1283-42C5-8CE5-7F1CD0B68F36@postgrespro.ru>
	<CAMGcDxfBkghqK94VZoOBE4XaOA9xZmkaM-opKeEzOrPmajVHBA@mail.gmail.com>
	<D6F3575D-BA17-43AB-A75F-12934885BADB@postgrespro.ru>
	<cd6a59942f42c37adc19eae23dfe701c@postgrespro.ru>
	<0e46521cbbca66c3298d1a9d672c9af0@postgrespro.ru>
	<CAMsr+YF4QfAKzsfHQ7MS+5NG3aY-NG3T_DdhcdPEPkWD4fo7fQ@mail.gmail.com>
	<CAMGcDxf83P5SGnGH52=_0wRP9pO6uRWCMRwAA0nxKtZvir2_vQ@mail.gmail.com>
	<CAMsr+YGX1z5t_MccrJxd4VJPgZKx17EsAQcAQ_1iJ4dKDp0LOg@mail.gmail.com>
	<CAMGcDxeDd4uB+tvaYrtjLgykeOpa-5nwPetNM+prCQ=wpPmPaQ@mail.gmail.com>
	<CAMsr+YH_x7Lrz3arUewzAk4=FZ-+hdum-eW7gZJBAEmzo937eg@mail.gmail.com>
	<e55b1240-df0b-c5eb-bcdb-18902cdf42f8@2ndquadrant.com>
	<CAMsr+YGE84n5_1Z=xNwaRxS3Fx6WS7=FLcYtezt1wRx7VNjW0Q@mail.gmail.com>
	<CAMGcDxfin6iYuHN1_21Z7YYvPDU9qLgfBSBYti1KWiUUpJBr7g@mail.gmail.com>
	<CAMGcDxf0YDPxgG3sU=0k8zTZniEe2RhT90v4BP__3a1P4iHpEQ@mail.gmail.com>
	<45525c30-4002-861e-a82c-3b95b19d1514@2ndquadrant.com>

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

Attachments:

0001-fixup-Original-patch.patch (text/plain, 1.2K) download From 0beddc4b47d160d4fcd9e99d23a90c4273b32c41 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut <peter_e@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

view thread (644+ messages)  latest in thread

Message-ID: <f351fc25-7b4d-3bf3-0398-d8a55bb3bd87@2ndquadrant.com>
Permalink:  ../f351fc25-7b4d-3bf3-0398-d8a55bb3bd87@2ndquadrant.com/
Also on:    postgresql.org/message-id/f351fc25-7b4d-3bf3-0398-d8a55bb3bd87@2ndquadrant.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, nikhils@2ndquadrant.com, craig@2ndquadrant.com, petr.jelinek@2ndquadrant.com, y.sokolov@postgrespro.ru, s.kelvich@postgrespro.ru, andres@anarazel.de, 9erthalion6@gmail.com, tgl@sss.pgh.pa.us, sawada.mshk@gmail.com, simon@2ndquadrant.com, robertmhaas@gmail.com
  Subject: Re: [HACKERS] logical decoding of two-phase transactions
  In-Reply-To: <f351fc25-7b4d-3bf3-0398-d8a55bb3bd87@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox