Hello! On Mon, Jan 19, 2026 at 11:59 PM Mihail Nikalayeu <[email protected]> wrote: >It fails with the state then we have 2 indexes (leaf_part_rri->ri_NumIndices=2) and EACH OF them have an ancestor. So, both of them are added as arbiters.
I found the cause of the issue. As Álvaro mentioned early - get_partition_ancestors does not uses any caches, so, each scan invalidates catalog snapshot [0]. In our case for first index - snapshot sees data before index_concurrently_swap committed, but for second one - after. It is rear case, but possible. It is not a new problem (caused by that patch set), the same may happen before, but in little bit different way: 1) some index selected (old one) for plan 2) index_concurrently_swap committed 3) get_partition_ancestors uses new catalog snapshot and sees 0 ancestors for the index - the same error So, test found the issue - great. I'll prepare the fix and additonal test later this week. Mikhail. [0]: https://github.com/postgres/postgres/blob/451c43974f8e199097d97624a4952ad0973cea61/src/backend/utils/time/snapmgr.c#L409-L419
