Re: BUG #18815: Logical replication worker Segmentation fault
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas@vondra.me>
Cc: Sergey Belyashov <sergey.belyashov@gmail.com>,
pgsql-bugs@lists.postgresql.org
Date: 2025-02-17T20:13:00Z
Lists: pgsql-bugs, pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix uninitialized index information access during apply.
- 12eece5fd54c 18.0 landed
-
Assert that ExecOpenIndices and ExecCloseIndices are not repeated.
- e596e077bbb3 18.0 landed
-
Fix crash in brininsertcleanup during logical replication.
- 9ff68679b50f 18.0 landed
- 788baa9a25ae 17.5 landed
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