Re: Bug in logical decoding with DDL and subtransactions

Поиск
Список
Период
Сортировка
Искать

Re: Bug in logical decoding with DDL and subtransactions

От:
Rajesh Kumar Thandapani <rajeshkumarth@google.com>
Дата:
Вложения:
On Sat, Oct 17, 2026 at 12:02 PM Manu  wrote:
> One thing worth documenting: the guard relies on the catalog-changes flag
> never being cleared once set. That holds today, but a short comment or an
> Assert at the skip would make the dependency explicit for whoever adds a
> flag path later.

Hi Manu, Ayush,

Since this did not seem to get picked up as a formal patch yet, I put
together a v1 patch (attached) building on Ayush's snippet and your
feedback.

On top of the earlier snippet, it also returns early when
toptxn->tuplecids is already empty (so pure DML transactions avoid the
subxacts[] lookups), adds an Assert in ReorderBufferAddNewTupleCids()
that subxid has RBTXN_HAS_CATALOG_CHANGES set, and adds the
tuplecid_nested.spec permutation with a regular write in the outer
savepoint.

On an assert-enabled build of master, decoding a transaction with 50,000
catalog tuplecids followed by 5,000 rolled-back DML subtransactions drops
from ~2310 ms to ~104 ms, and all test_decoding tests pass.

Regards,
Rajesh Kumar Thandapani
FAQ