Re: BUG #15114: logical decoding Segmentation fault

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Петър Славов <pet(dot)slavov(at)gmail(dot)com>, 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-04-16 17:59:01
Message-ID: 20180416175901.mdevawuuhvwo3yk6@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Alvaro Herrera wrote:

> I agree -- I think logicalrep_write_attrs() should not use
> RelationGetIndexAttrBitmap at all but instead use some lower-level way
> to obtain columns of the replica identity. I don't know whether there
> are historical-snapshot-related considerations to care about, in this
> code, though.

Here's a patch. There is a disadvantage: one additional syscache lookup
each time logicalrep_write_attrs() is called. I think that's all right,
since that's done once for each relation being replicated (not, say,
once per tuple or once per transaction). Even so, I tried to move this
code as a special "quick-path" case in RelationGetIndexAttrBitmap, so
that it could be cached separately without processing the other indexes.
That turned out a bit too messy for my taste.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
proto.patch text/plain 1.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Emre Hasegeli 2018-04-16 17:59:19 Re: Wrong Results from SP-GiST with Collations
Previous Message Alvaro Herrera 2018-04-16 17:48:17 Re: BUG #15144: *** glibc detected *** postgres: postgres smsconsole [local] SELECT: double free or corruption (!pre