Skip to content

sql: dropping objects should work even if the objects are invalid #50651

@jordanlewis

Description

@jordanlewis

We've begun to see several issues around invalid table descriptor state creeping into the database. This is very troublesome, and we of course would prefer to never have bugs like this in the first place. But, bugs happen. We need to make it easier for people to recover from such situations.

The first reaction of many users upon encountering a "broken seeming" table or object is to try to DROP that object. Our well-intentioned validate methods tend to prevent this from happening, since we try to validate the object before doing anything else.

This issue tracks modifying DROP to care less about validation errors. I think they should still be logged and reported to sentry, and possibly returned to the user as a WARNING, but they shouldn't block the DROP.

A good example of this kind of issue is #50649. The issue prevents the object from being dropped altogether. This is unreasonable - we should obey the user's request and drop the object. Otherwise, the object will enter an unrecoverable state.

Epic CRDB-60817

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions