Re: BUG #15114: logical decoding Segmentation fault

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, Петър Славов <pet(dot)slavov(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, 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-31 07:29:38
Message-ID: 20181031072938.GC7862@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Oct 30, 2018 at 04:09:31PM -0700, Andres Freund wrote:
> Replication needs to maintain the other indexes, and for that it needs
> to evaluate predicates. So I don't understand how you could say that
> it doesn't need to know about other indexes?

You are right, sorry for the noise. The worker applies the changes so
it needs to know about all the indexes and its information. So we need
to tackle three separate issues here then:
1) On the sender side, make sure that only the replica index information
is fetched. I actually would prefer something like what Alvaro proposed
upthread, to not save the saved information into the cached Relation,
and potentially have RelationGetIndexAttrBitmap() overwrite it.
2) On the apply side, move the snapshot build a bit earlier so as the
index information can be built properly.
3) Make sure that RelationGetIndexAttrBitmap() never gets called if
there is no snapshot available.

1) and 2) are the actual bug fixes to back-patch. 3) is optionally
something for HEAD, which Petr proposed.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message graham labdon 2018-10-31 11:34:26 Font Size
Previous Message Pavel Stehule 2018-10-31 07:08:47 Re: BEFORE triggers that return NULL can circumvent referential integrity