Skip to content

GC Stats Blocked Indefinitely #59867

@0xPoe

Description

@0xPoe

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. Start a TiDB cluster: tiup playground v8.5.1
  2. Run the below queries and do the same operation 1 million times.
CREATE DATABASE IF NOT EXISTS test;
USE test;
CREATE TABLE sbtest (
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL
)
PARTITION BY RANGE (id) (
    PARTITION p0 VALUES LESS THAN (100),
    PARTITION p1 VALUES LESS THAN (200),
    PARTITION p2 VALUES LESS THAN (300),
    PARTITION p3 VALUES LESS THAN (400)
);
INSERT INTO sbtest (name) VALUES ('Test1'), ('Test2'), ('Test3'), ('Test4');
ANALYZE TABLE sbtest;
CREATE TABLE sbtest_new LIKE sbtest;
INSERT INTO sbtest_new SELECT * FROM sbtest;
DROP TABLE sbtest;
ALTER TABLE sbtest_new RENAME TO sbtest;
ANALYZE TABLE sbtest;
  1. Check how many rows in the mysql.stats_meta table:
select * from mysql.stats_meta
  1. Wait for 20 minutes and check again:
select * from mysql.stats_meta

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

The old table's metadata has been deleted.

3. What did you see instead (Required)

It is still in the mysql.stats_meta table.

4. What is your TiDB version? (Required)

v8.5.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions