Re: BUG #15114: logical decoding Segmentation fault

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
Cc: Петър Славов <pet(dot)slavov(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: BUG #15114: logical decoding Segmentation fault
Date: 2018-10-29 01:54:38
Message-ID: 20181029015438.GC14242@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2018-10-29 02:44:59 Re: BUG #15437: Segfault during insert into declarative partitioned table with a trigger creating partition
Previous Message Petr Jelinek 2018-10-28 22:59:49 Re: BUG #15114: logical decoding Segmentation fault