Re: BUG #15114: logical decoding Segmentation fault - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #15114: logical decoding Segmentation fault
Date
Msg-id 56d0ccb4-e9c9-1225-256d-c287adf5494e@2ndquadrant.com
Whole thread Raw
In response to Re: BUG #15114: logical decoding Segmentation fault  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: BUG #15114: logical decoding Segmentation fault  (Noah Misch <noah@leadboat.com>)
Re: BUG #15114: logical decoding Segmentation fault  (Michael Paquier <michael@paquier.xyz>)
List pgsql-bugs
I have another approach for this.

Recall that the issue is ultimately that RelationGetIndexAttrBitmap()
might need a snapshot under certain circumstances, and it will crash if
there isn't one.  There are actually two separate bugs, in the publisher
and in the subscriber.  Some patches have been proposed in this thread
that either bypass RelationGetIndexAttrBitmap() or obtain a snapshot at
different times in the publisher or subscriber code.

My approach is to make RelationGetIndexAttrBitmap() not need a snapshot.
 The whole code was overly complicated anyway, calling BuildIndexInfo()
and then throwing the result away.  We can do it directly more
efficiently and avoid all the business about eval_const_expressions().
Moreover, this fixes the problem in a central place and does not require
bespoke separate fixes in the publisher and subscriber code.  External
logical decoding or logical replication implementations could also be
affected and would benefit from this fix.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Suggestion: include interruption method for \watch option (page1922, PostgreSQL 11.1 Documentation)
Next
From: Noah Misch
Date:
Subject: Re: BUG #15114: logical decoding Segmentation fault