Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadInfoSchema() slow when there are background query visiting INFORMATION_SCHEMA.TABLES #58363

Closed
tiancaiamao opened this issue Dec 18, 2024 · 1 comment · Fixed by #58466
Closed
Assignees
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@tiancaiamao
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

1M table in the cluster already, run 'create table' workload together with a "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = xxx' workload.

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

DDL should be fast enough.

3. What did you see instead (Required)

DDL is slow, and the LoadSchemaDiff takes a long time.

Image

Image

Image

4. What is your TiDB version? (Required)

master

commit dde1dcd750d3037c8f4576d8bcca716a1b91cd09 (HEAD -> master, origin/master, origin/HEAD)
Author: Rustin <tech@rustin.me>
Date:   Tue Dec 17 18:05:42 2024 +0800

    session: add indexes for `mysql.analyze_jobs` (#58134)
    
    close pingcap/tidb#57996
@tiancaiamao tiancaiamao added affects-8.5 This bug affects the 8.5.x(LTS) versions. severity/moderate type/bug The issue is confirmed as a bug. labels Dec 18, 2024
@tiancaiamao tiancaiamao self-assigned this Dec 18, 2024
@tiancaiamao
Copy link
Contributor Author

It could be caused by the mutex lock contention.

Visiting INFORMATION_SCHEMA.TABLES hold the lock for a long time.
LoadSchemaDiff need to rebuild schema and add new record to the btree.
They conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants