Skip to content

schemastore: DROP DATABASE does not mark table info as deleted #5962

Description

@lidezhu

What did you do?

ActionDropSchema removes table metadata and updates DDL history, but does not apply a deletion version to registered or lazily loaded versionedTableInfoStore instances.

As a result, GetTableInfo(tableID, ts >= dropTs) may return stale TableInfo, causing a dropped table to be treated as valid during recovery or dispatcher reset.

What did you expect to see?

GetTableInfo should return TableDeletedError for all physical tables in the dropped database at or after dropTs.

What did you see instead?

As described above

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

(paste TiDB cluster version here)

Upstream TiKV version (execute tikv-server --version):

(paste TiKV version here)

TiCDC version (execute cdc version):

(paste TiCDC version here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-8.5This bug affects the 8.5.x(LTS) versions.severity/minortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions