Technical Advisory 74385

On this page Carat arrow pointing down

Publication date: January 6, 2022

Description

Partial indexes can be corrupted by UPDATE 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 WHERE clauses.
  • An UPDATE must be issued to the table which updates a column(s) included in one of the indexes but not another.

CockroachDB versions 21.1 and 21.2 are affected by this bug until maintenance versions 21.1.13 and 21.2.4.

Statement

This bug was resolved in CockroachDB by PR 74431. The fix has been applied to maintenance versions 21.1.13 and 21.2.4 of CockroachDB. The public issue is tracked by issue 74385.

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 the WHERE 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. Workarounds are discussed in more detail in issue 74385.

Impact

Partial indexes in the same table with identical WHERE clauses can become corrupt and cause incorrect query results.

Please reach out to the support team if you need more information or assistance.


Yes No
On this page

Yes No