pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Petr Jelinek <petr.jelinek@2ndquadrant.com>
Cc: Петър Славов <pet.slavov@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Andres Freund <andres@anarazel.de>
Cc: Petr Jelinek <petr@2ndquadrant.com>
Cc: pgsql-bugs@lists.postgresql.org, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Subject: Re: BUG #15114: logical decoding Segmentation fault
Date: Mon, 29 Oct 2018 10:54:38 +0900
Message-ID: <20181029015438.GC14242@paquier.xyz> (raw)
In-Reply-To: <11af0d1b-e48f-fba3-5b1e-49886f648f52@2ndquadrant.com>
References: <20180326160801.ja4j43hwrc35iuhb@alvherre.pgsql>
	<20180416175901.mdevawuuhvwo3yk6@alvherre.pgsql>
	<CAC5T6EBGj6AfapRYORj8_hJR7A36uePdr3Ds5n4yy6=ktcQCyg@mail.gmail.com>
	<20180427012203.GG3419@paquier.xyz>
	<CAC5T6ED-Ti3Ryw9oU-o0JpQ=S3UNZ7BoQJCGzqb=t5736qrPzQ@mail.gmail.com>
	<11af0d1b-e48f-fba3-5b1e-49886f648f52@2ndquadrant.com>

On Sun, Oct 28, 2018 at 11:59:49PM +0100, Petr Jelinek wrote:
> I wrote my own patch to solve this which is quite similar to Alvaro's
> except that it does not do the manual work to build indexes list as we
> already have RelationGetReplicaIndex which does all the necessary work
> and also uses the same rd_idattr for cache that
> RelationGetIndexAttrBitmap does, it's better for performance and looks
> safe to me.
> 
> I attached both patch for PG11+ (ie master) and the backport patch for
> PG10, they only differ in the line identified above as problematic.

Hmm.  I am studying this patch, and this visibly cannot be easily
reproduced?  I would have imagined that something like this would be
enough, with a predicate index on the publisher side which is in charge
of loading the :
-- connect to publisher
\c postgres postgres /tmp 5432
create table aa (a int not null, b int);
create function copy_int(a int) returns int as $$ select $1 $$
  language sql immutable;
create index aai on aa (b) where copy_int(b) > 0;
create unique index aai2 on aa (a);
alter table aa replica identity using index aai2;
create publication big_tables for table aa;
insert into aa values (generate_series(1,100), 1);

-- connect to subscriber
\c postgres postgres /tmp 5433
create table aa (a int not null, b int);
create function copy_int(a int) returns int as $$ select $1 $$
  language sql immutable;
create index aai on aa (b) where copy_int(b) > 0;
create unique index aai2 on aa (a);
alter table aa replica identity using index aai2;
create subscription sub_name CONNECTION 'host=/tmp dbname=postgres
user=postgres' PUBLICATION big_tables;

Is there something I am missing?

If possible, could it be possible to add a test case in
001_rep_changes.pl with a more complete schema? 
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (30+ messages)  latest in thread

Message-ID: <20181029015438.GC14242@paquier.xyz>
Permalink:  ../20181029015438.GC14242@paquier.xyz/
Also on:    postgresql.org/message-id/20181029015438.GC14242@paquier.xyz

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, petr.jelinek@2ndquadrant.com, pet.slavov@gmail.com, alvherre@alvh.no-ip.org, andres@anarazel.de, petr@2ndquadrant.com, peter.eisentraut@2ndquadrant.com
  Subject: Re: BUG #15114: logical decoding Segmentation fault
  In-Reply-To: <20181029015438.GC14242@paquier.xyz>
  References: <20180326160801.ja4j43hwrc35iuhb@alvherre.pgsql> <20180416175901.mdevawuuhvwo3yk6@alvherre.pgsql> <CAC5T6EBGj6AfapRYORj8_hJR7A36uePdr3Ds5n4yy6=ktcQCyg@mail.gmail.com> <20180427012203.GG3419@paquier.xyz> <CAC5T6ED-Ti3Ryw9oU-o0JpQ=S3UNZ7BoQJCGzqb=t5736qrPzQ@mail.gmail.com> <11af0d1b-e48f-fba3-5b1e-49886f648f52@2ndquadrant.com> <20181029015438.GC14242@paquier.xyz>

* 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