pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas@vondra.me>
Cc: Sergey Belyashov <sergey.belyashov@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18815: Logical replication worker Segmentation fault
Date: Mon, 17 Feb 2025 15:13:00 -0500
Message-ID: <911898.1739823180@sss.pgh.pa.us> (raw)
In-Reply-To: <906545.1739821437@sss.pgh.pa.us>
References: <18815-2a0407cc7f40b327@postgresql.org>
	<832225.1739810351@sss.pgh.pa.us>
	<CAOe0RDwbowSGv8qeuqyHzJndtwV5JyPEG4YwmaAvgquC=gjz+Q@mail.gmail.com>
	<906545.1739821437@sss.pgh.pa.us>

I wrote:
> I suspect that the attached will fix it.  What I don't understand
> is why it's apparently so hard to trigger the crash, because it
> looks to me like any two successive insert commands on the same
> BRIN index should hit this.

Oh, wait: I was confusing ii_AmCache with rd_amcache in the index's
relcache entry.  This coding would absolutely not work with rd_amcache
since that's persistent.  It mostly works with the IndexInfo field
though, since an IndexInfo typically only survives per-query.
Evidently there's some path in logical replication that will re-use an
IndexInfo across multiple distinct insertion operations, and that's
what breaks it.

> BTW, I'm also a bit suspicious of the comment's claim that the
> brinDesc doesn't need cleanup.  That looks like a potential
> memory leak.

This concern still stands.

			regards, tom lane





view thread (23+ messages)  latest in thread

Message-ID: <911898.1739823180@sss.pgh.pa.us>
Permalink:  ../911898.1739823180@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/911898.1739823180@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tomas@vondra.me, sergey.belyashov@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18815: Logical replication worker Segmentation fault
  In-Reply-To: <911898.1739823180@sss.pgh.pa.us>

* 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