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

the time returned to the client is inconsistent with the ddl job info for truncate table #44785

Closed
aytrack opened this issue Jun 19, 2023 · 2 comments · Fixed by #45234
Closed
Assignees
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented Jun 19, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. tiup playground nightly --tiflash 0
create table t02(a int, b int, primary key (a)) partition by hash(a) partitions 1000;
truncate table t02;
truncate table t02;
truncate table t02;

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

the time for truncate table from ddl jobs info should consistent with client's time

3. What did you see instead (Required)

you can see that client wait a long time but the ddl info record only a few time.
图片
图片

4. What is your TiDB version? (Required)

[16:34:51]TiDB root:test> select tidb_version();
+-----------------------------------------------------------+
| tidb_version()                                            |
+-----------------------------------------------------------+
| Release Version: v7.2.0-alpha                             |
| Edition: Community                                        |
| Git Commit Hash: 8633c8ce9921bf17a92b582a6b5d299d95213ac6 |
| Git Branch: heads/refs/tags/v7.2.0-alpha                  |
| UTC Build Time: 2023-06-15 14:25:30                       |
| GoVersion: go1.20.3                                       |
| Race Enabled: false                                       |
| Check Table Before Drop: false                            |
| Store: tikv                                               |
+-----------------------------------------------------------+
@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra severity/moderate labels Jun 19, 2023
@mjonss
Copy link
Contributor

mjonss commented Jun 19, 2023

I would propose to move the preSplitAndScatter call into the ddl worker instead, probably directly after the new table/partitions are created, before they are public to be written.

@crazycs520
Copy link
Contributor

crazycs520 commented Jul 7, 2023

I don't think this requirement is reasonable, and we don't promise that the DDL job time is equal to the execution time of the DDL SQL statement. DDL job execution time is only a part, not the whole time, of DDL SQL statement execution time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants