model-writtenrun 4241 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported an assertion failure when attaching an index beneath an invalid partitioned index whose parent was already valid, reproducing the problem from PostgreSQL 11 through master #1; Tom Lane argued that the underlying behavior needed fixing rather than simply removing the assertion #2.
- Michael Paquier considered invalidating ancestors or completing missing descendant indexes, then proposed skipping invalid matching indexes during ATTACH PARTITION so valid replacements would be created #3 #4.
- Alexander supported the attachment fix, noted that it would leave the invalid index orphaned, and suggested moving its regression test into indexing.sql #5.
- Alexander tested failed concurrent index builds and found a separate CREATE INDEX case that left a valid ancestor above invalid descendants; he also observed that REINDEX repaired leaf validity without updating parent flags #6.
- Michael reported applying the attachment fix through PostgreSQL 11 and identified the recursive creation case as a second bug, explaining that a valid partitioned index must have valid index partitions #7.
- For the second bug, Michael retained reuse of invalid matching indexes and instead made DefineIndex() propagate their invalidity upward, checking newly created child indexes and making catalog updates visible between recursive calls #8.
- Alexander's extended tests showed that detaching or repairing an invalid leaf could leave ancestors marked invalid; Michael kept that broader revalidation issue outside the creation fix, which Alexander explicitly endorsed #9 #10 #11.
- Michael committed #8 with unchanged code and tests as cfc43aeb38, backpatched through PostgreSQL 11, and reported a healthy buildfarm while acknowledging room for more opportunistic parent revalidation #12.
- During release-note preparation, Tom questioned why ATTACH PARTITION rejected invalid matching indexes while CREATE INDEX reused them and invalidated ancestors, asking whether the creation fix made the attachment change unnecessary #13.
- Michael defended retaining both fixes because attachment should avoid making an existing valid index tree invalid, and requested Álvaro's input; the thread ended with both fixes reported landed but their differing semantics and broader revalidation behavior still under discussion #14.