Description
Partial indexes can be corrupted byUPDATE statements, resulting in incorrect query results for any queries that use the partial index. Corruption can occur only under the following conditions:
- A table must have two or more partial indexes, unique or non-unique, with identical
WHEREclauses. - An
UPDATEmust be issued to the table which updates a column(s) included in one of the indexes but not another.
Statement
The fix has been applied to maintenance versions 21.1.13 and 21.2.4 of CockroachDB.Mitigation
Users of CockroachDB are encouraged to upgrade to a maintenance version with the fix applied. Once the upgrade is complete, all partial indexes should be dropped and recreated to ensure that no indexes remain corrupt. To avoid the issue without upgrading, users should remove or alter theWHERE clause of partial indexes such that no table has two or more partial indexes with the same WHERE clause. Be aware that removing or altering unique partial indexes can change their uniqueness guarantees.
Impact
Partial indexes in the same table with identicalWHERE clauses can become corrupt and cause incorrect query results.
Please reach out to the support team if you need more information or assistance.
