Re: BUG #17997: Assert failed in validatePartitionedIndex() when attaching partition index to child of valid index
Alexander Law <exclusion@gmail.com>
From: Alexander Lakhin <exclusion@gmail.com>
To: Michael Paquier <michael@paquier.xyz>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2023-06-27T11:00:00Z
Lists: pgsql-bugs
26.06.2023 11:05, Michael Paquier wrote: > A third solution that came into my mind just now would be to revisit > the choice done in AttachPartitionEnsureIndexes() where an invalid > index can be chosen as a match when creating the indexes on the > partitions, so as we are able to get to the bottom of a chain with > valid indexes for the whole tree. I have been testing the attached > and it has been working here the way I'd expect when manipulating > partition trees with ATTACH PARTITION, though this breaks the scenario > of this bug report because we would now get a failure when attempting > to attach an index in the last command. Thanks for the fix! This solution seems sensible to me. The only downside I see is that an invalid index would be left orphaned after ATTACH PARTITION, but I couldn't find in doc/ or src/test/regress/ any promises that such index must be used. I also don't see a way to make a previously valid index inside the partition index tree invalid and available to attaching a child index to it in the same time. Beside that, maybe it would be better to place the test for the fix in indexing.sql, where many similar operations with partitioned indexes are performed. Best regards, Alexander
Commits
-
Fix marking of indisvalid for partitioned indexes at creation
- c75c33de5bab 11.21 landed
- dbe0e5c56f31 12.16 landed
- 537b70b82c2c 13.12 landed
- 663b35f2df62 14.9 landed
- cb4ac3e5685f 15.4 landed
- f4691e2e76a4 16.0 landed
- cfc43aeb3810 17.0 landed