Skip to main content
Publication date: July 19, 2022

Description

The problem affects multi-region tables whose locality has been altered to REGIONAL BY ROW in clusters running versions to . The problem occurs when dropping a region: the drop may proceed when instead it should have yielded an error. Any subsequent attempt at changing the locality of the table will fail with an internal error. This can be reproduced as follows in cockroach demo --multitenant=false --global --nodes 9 --insecure --empty:
At this point the following statement should fail but instead succeeds:
After which the following statement fails instead of succeeding:

Statement

This is resolved in CockroachDB by fixes which ensure that: back-references to tables using the region enum type are correctly updated in the region enum type descriptor when performing ALTER TABLE … SET LOCALITY REGIONAL BY ROW; any existing type descriptors which are already missing these back-references are updated prior to ALTER DATABASE … DROP [SUPER] REGION so as to ensure its correct behavior. The fix has been applied to the maintenance release of CockroachDB .

Mitigation

Users of CockroachDB v22.1.0 to v22.1.3 with multi-region databases are encouraged to upgrade to the maintenance version or above.

Impact

Versions v22.1.0 to v22.1.3 are affected. In these versions, multi-region tables whose locality has been altered to REGIONAL BY ROW are at risk of being corrupted. Questions about any technical alert can be directed to our support team.