-
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: Remove expired keys on PD #10406
Conversation
/run-all-tests |
Codecov Report
@@ Coverage Diff @@
## master #10406 +/- ##
================================================
- Coverage 78.1549% 77.7447% -0.4102%
================================================
Files 413 410 -3
Lines 87498 84443 -3055
================================================
- Hits 68384 65650 -2734
+ Misses 13971 13886 -85
+ Partials 5143 4907 -236 |
|
||
select { | ||
case <-s.notifyCleanExpiredPathsCh: | ||
for i := 0; i < opDefaultRetryCnt; i++ { |
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.
We can extract these codes into a func, to make it more readable.
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 think it's OK. Here only get leases and do doCleanExpirePaths
.
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.
but the break
in line 433 is not very obvious.
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.
It does a retry, I think it's OK.
PTAL @winkyao @bb7133 @crazycs520 |
Codecov Report
@@ Coverage Diff @@
## master #10406 +/- ##
================================================
+ Coverage 80.8732% 80.9097% +0.0365%
================================================
Files 419 419
Lines 88661 88684 +23
================================================
+ Hits 71703 71754 +51
+ Misses 11731 11700 -31
- Partials 5227 5230 +3 |
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.
rest LGTM
@zimulala Please address comments |
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
/run-all-tests |
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
// WaitTimeWhenErrorOccured is waiting interval when processing DDL jobs encounter errors. | ||
WaitTimeWhenErrorOccured = 1 * time.Second | ||
// ddlLogCtx uses for log. | ||
ddlLogCtx = context.Background() |
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.
Lots of logutil.Logger(context.Background())
code snippets exist in this repo, I think we can provide a utility function logutil.BgLogger()
to improve it.
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.
We can refactor it in other PR.
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.
OK
PTAL @lonng |
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
/run-unit-test |
/run-integration-ddl-test tidb-test=pr/835 |
/run-common-test tidb-test=pr/835 |
What problem does this PR solve?
We encounter the problem of etcd-io/etcd#9935. And @nolouch pull a PR to fix it.
Just in case, let's do a protective function.
What is changed and how it works?
Regularly deleted expired paths on etcd.
Check List
Tests
Related changes