Both CREATE TABLE and CREATE VIEW can modify descriptors of other tables/views than the one being created, to update either their depended-on list (for CREATE VIEW) or their index list (for CREATE TABLE with FKs).
When creating a view over a system table, or creating a new index on a system table for a FK from a non-system table, a system descriptor is updated.
In order to ensure that the update is propagated the KV transaction should be anchored on the system range (using SetSystemConfigTrigger), or cause an error if the anchor is already set.
This is not currently done / checked properly. This causes possible inconsistent state of the system descriptors across the cluster.
Found while working on #17310.
Both CREATE TABLE and CREATE VIEW can modify descriptors of other tables/views than the one being created, to update either their depended-on list (for CREATE VIEW) or their index list (for CREATE TABLE with FKs).
When creating a view over a system table, or creating a new index on a system table for a FK from a non-system table, a system descriptor is updated.
In order to ensure that the update is propagated the KV transaction should be anchored on the system range (using
SetSystemConfigTrigger), or cause an error if the anchor is already set.This is not currently done / checked properly. This causes possible inconsistent state of the system descriptors across the cluster.
Found while working on #17310.