Skip to content

TiDB cannot clean up the stats meta after dropping the database #57230

@0xPoe

Description

@0xPoe

Bug Report

TiDB cannot clean up the stats meta after dropping the database.

1. Minimal reproduce step (Required)

  1. Start a TiDB cluser
  2. Use the test database
  3. Create a table and insert some data
CREATE TABLE test.my_table (
    id INT PRIMARY KEY,
    name VARCHAR(255),
    value INT
);

INSERT INTO test.my_table (id, name, value)
WITH RECURSIVE numbers AS (
    SELECT 1 as n
    UNION ALL
    SELECT n + 1 FROM numbers WHERE n < 1000
)
SELECT
    n as id,
    CONCAT('Name_', n) as name,
    FLOOR(RAND() * 1000) as value
FROM numbers;
  1. Wait for 10 minutes
  2. Drop the database.
  3. Wait for another 20 minutes, and check the stats meta.

2. What did you expect to see? (Required)

The stats meta is correctly deleted.

3. What did you see instead (Required)

It is still there.

4. What is your TiDB version? (Required)

all the versions

Metadata

Metadata

Assignees

Labels

affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.component/statisticsseverity/moderatesig/plannerSIG: Plannertype/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