Fix snapshot handling bug in recent BRIN fix
authorÁlvaro Herrera <[email protected]>
Tue, 4 Nov 2025 19:31:43 +0000 (20:31 +0100)
committerÁlvaro Herrera <[email protected]>
Tue, 4 Nov 2025 19:31:43 +0000 (20:31 +0100)
commitef81697fee774d3e21e0c479f3f9515a7d0f256f
tree773da1ac9c6c551573ed6e2385f2afb1b107c8d6
parentd7aeb03d2418f3c01b125218f62af41ffad1aacf
Fix snapshot handling bug in recent BRIN fix

Commit a95e3d84c0e0 added ActiveSnapshot push+pop when processing
work-items (BRIN autosummarization), but forgot to handle the case of
a transaction failing during the run, which drops the snapshot untimely.
Fix by making the pop conditional on an element being actually there.

Author: Álvaro Herrera <[email protected]>
Backpatch-through: 13
Discussion: https://postgr.es/m/202511041648[email protected]
src/backend/postmaster/autovacuum.c