-
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
server: only owner do bootstrap #10029
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10029 +/- ##
===========================================
Coverage ? 78.0309%
===========================================
Files ? 405
Lines ? 82161
Branches ? 0
===========================================
Hits ? 64111
Misses ? 13342
Partials ? 4708 |
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.
Do we need some logs here?
Such as, logutil.Logger(context.Background()).Info("bootstrap success");
LGTM |
… into bootstrap-in-owner
@xiekeyi98 After consideration, I think print "bootstrap success" log here is too early, there is a lot of other jobs need to do. Maybe we can add this log in some other place. |
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
@zimulala PTAL |
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
… into bootstrap-in-owner
/run-all-tests |
/run-all-tests |
/run-all-tests |
The cancelled jobs have only a few info. Is it a bug?
|
Because the table name is got from domin.infoschema by table ID, but the create table job was cancelled, so can't find table by job.tableID. Maybe we can get the table name from job.Arg. |
What problem does this PR solve?
implement issue: #10017
When there multiple tidb-server do bootstrap, there will be multiple conflict when create system table.
Below is result when I start 5 tidb-server at the same time:
As you can see, there are multiple DDL-job was been canceled.
Actual only 1 tidb-server need to do bootstrap to create system table.
So which one? The DDL-owner
What is changed and how it works?
Add a judge to check whether is owner? If is owner, to do bootstrap to create system table.
In this PR, start 5 tidb-server at the same time, there is no conflict.
Check List
Tests
Code changes
Side effects
Related changes