Re: BRIN autosummarization lacking a snapshot
Álvaro Herrera <alvherre@kurilemu.de>
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Michael Paquier <michael@paquier.xyz>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-04T17:37:14Z
Lists: 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 snapshot handling bug in recent BRIN fix
- ef81697fee77 13.23 landed
- bcfbd3f747d7 15.15 landed
- 8733f0b54c05 18.1 landed
- 65b0d1f74098 14.20 landed
- 3b5007347b5d 17.7 landed
- 20442cf5075d 16.11 landed
- 0a3d27bfe0fb 19 (unreleased) landed
-
BRIN autosummarization may need a snapshot
- f4b68b0336bd 17.7 landed
- f0ad41716197 14.20 landed
- a95e3d84c0e0 19 (unreleased) landed
- 6ef33c8051dd 16.11 landed
- 419ffde23546 18.1 landed
- 3c7b47974ec7 13.23 landed
- 23ddadf6835e 15.15 landed
Attachments
- 0001-fix-brin-failure.patch (text/x-diff)
On 2025-Nov-04, Álvaro Herrera wrote: > Ah, the problem is that perform_work_item() pushes an active snapshot > before calling the BRIN function, but because of the error, we > terminate the transaction before returning, so when we try to Pop that > snapshot, it doesn't exist anymore. Other ways for this to happen would > be an autovacuum worker trying to run an item for a dropped table (the > "goto deleted2" case). Of course, the answer is just to inquire ActiveSnapshotSet() beforehand. I tested this by adding an elog(ERROR) in perform_work_item() -- without this fix, I see a segfault, which disappears with it. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Debido a que la velocidad de la luz es mucho mayor que la del sonido, algunas personas nos parecen brillantes un minuto antes de escuchar las pelotudeces que dicen." (Roberto Fontanarrosa)