Skip to content

sql: CREATE VIEW or FKs over system tables do not set the system config trigger #17405

@knz

Description

@knz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions