-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: provide a option to wait for init stats to finish before providing service during startup #43381
Conversation
…rvice during startup
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/test unit-test |
domain/domain.go
Outdated
@@ -2176,6 +2176,7 @@ func (do *Domain) loadStatsWorker() { | |||
} else { | |||
logutil.BgLogger().Info("init stats info time", zap.Bool("lite", liteInitStats), zap.Duration("take time", time.Since(t))) | |||
} | |||
close(statsHandle.InitStatsDone) |
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.
Better to add this line to the above defer function.
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.
Updated.
/test all |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
What problem does this PR solve?
Issue Number: close #43385 ref #42160
Problem Summary:
What is changed and how it works?
Introduce the configuration
force-init-stats
, which indicates whether to wait for init stats to finish before providing service during startup.Check List
Tests
Add
time.Sleep(30 * time.Second)
at the beginning of init stats to simulate slow init stats. Start the tidb node with settingforce-init-stats
to true. The connection from mysql client is accepted after init stats is finished(after roughly 30 sec).Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.