freenode
Databases & Infrastructure

PostgreSQL logical decoding crash under fix for all stables

A layout-dependent assertion failure after DDL in rolled-back savepoints is hitting the buildfarm and is slated for backpatch before the next minors.

PostgreSQL developers are pushing to land a fix for a logical decoding bug that can crash the backend when decoding transactions that mix catalog DDL with rolled-back subtransactions.

Tracked as bug 19555, the failure appears as an assertion in the reorder buffer when it rebuilds tuple command-ID maps. If a CREATE or ALTER runs inside a savepoint that is then rolled back, NEW_CID records from the aborted subtransaction can remain queued under the top-level transaction. On-access pruning may free the aborted catalog line pointer; a later catalog insert in the same top-level transaction can reuse that TID with a different cmin. Decoding then sees a conflicting mapping and, on assert builds, aborts.

The crash is layout-dependent and was long intermittent, but buildfarm animals have begun failing the test_decoding DDL regression often enough to draw committer attention. Tom Lane has urged a fix before PostgreSQL 19 GA, with Álvaro Herrera arguing the real deadline is the November minor releases and that every supported branch needs the same repair.

Bingshuai Li, building on Mark Dilger's earlier diagnosis, has posted a fifth patch revision. It cleans aborted subtransactions' tuplecid entries at decode-abort time so reused TIDs no longer collide, adds a nested-subtransaction regression case, and is under review for whether the restart_lsn reasoning and O(N) abort cleanup are acceptable to backpatch.