Skip to main content
Publication date: July 18, 2022

Description

The problem can occur on any cluster running versions to or . If a CREATE MATERIALIZED VIEW statement fails, all the tables, views, sequences and types referenced in its SELECT query will become unusable. Any statement or query referencing these objects will trigger an error matching the following regular expression: invalid depended-on-by relation back reference: referenced table ID [0-9]*: referenced descriptor not found This problem can be diagnosed by running the following query:
If you get back a non-zero result, your cluster has the problem described in this technical advisory. If you get back zero, your cluster does not have this problem.

Statement

This is resolved in CockroachDB by a fix that addresses the missing removal of back-references to the materialized view. The fix has been applied to maintenance releases of CockroachDB v21.2.13 and v22.1.1.

Mitigation

Users of CockroachDB versions v21.2.0 to v21.2.12 or v22.1.0 are encouraged to upgrade to and or a later version. Upgrading to a later maintenance release will prevent this problem from appearing, but it will not fix the problem if it is already present. If the problem is present according to the diagnostic query above, users can attempt a repair by executing the following:
If the query succeeds, that means the repair has succeeded. You can rerun the diagnostic query to confirm this. We encourage users to back up their clusters before undertaking such a repair.

Impact

This problem affects any cluster in which a materialized view has been unsuccessfully created while running versions v21.2.0 to v21.2.12 or v22.1.0. All objects depended upon by that view would become unusable. Questions about any technical alert can be directed to our support team.