-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ddl: reduce the interval for checking "create table/schema" #7608
Conversation
ddl/ddl.go
Outdated
@@ -447,6 +447,9 @@ func checkJobMaxInterval(job *model.Job) time.Duration { | |||
if job.Type == model.ActionAddIndex { | |||
return 3 * time.Second | |||
} | |||
if job.Type == model.ActionCreateTable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a TODO
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not consider CreateDatabase/DropTable....?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shenli
"DropTable" has 4 states. So this operation takes longer than it takes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused by the context. Anyone help me out?
request add a TODO.
TODO for what?
Why not consider CreateDatabase/DropTable....?
you mean we reduce tick of CreateDatabase/DropTable
to 500ms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they are the same story with CreateTable.
you mean we reduce tick of CreateDatabase/DropTable to 500ms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zimulala How long does it usually take to drop table/database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shenli
This is the estimated time.
tidb> create database db;
Query OK, 0 rows affected (0.16 sec)
tidb> create table db.x(a int, b int);
Query OK, 0 rows affected (0.19 sec)
tidb> drop table db.x;
Query OK, 0 rows affected (0.39 sec)
tidb> drop database db;
Query OK, 0 rows affected (0.35 sec)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhexuany We will use etcd to notify the job is done in the future, therefore we needn't wait an uncertain time here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
After we put the DDL job into the job queue, the owner will handle the job in the background. We check every "tick" if the current job is completed. Handling the operation of "create table/schema" will be faster.
What is changed and how it works?
I changed the interval of "create table/schema" to 500ms.
Check List