Possible premature SNAPBUILD_CONSISTENT with DB-specific running_xacts
SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>
From: SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Álvaro Herrera <alvherre@kurilemu.de>, Antonin Houska <ah@cybertec.at>
Date: 2026-04-19T18:58:46Z
Lists: pgsql-hackers
Attachments
- v1-snapbuild-only.patch (application/octet-stream) patch v1
Hi hackers, A cluster-wide decoder must never have its snapshot-builder state changed by a database-specific running_xacts record. Adding a check to return it early. I think otherwise a cluster wide decoder can potentially go to SNAPSHOT_CONSISTENT state immediately even though transactions older than nextXid are still in progress on a different DB (not tracked by running_xact record). This race is now possible with cluster wide decoders and Repack concurrently run. Attached a patch to fix this. Thoughts? Thanks Satya