-
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
ddl: make sure put key into ETCD monotonously #52381
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #52381 +/- ##
================================================
- Coverage 70.7107% 70.1420% -0.5688%
================================================
Files 1492 1545 +53
Lines 440257 460239 +19982
================================================
+ Hits 311309 322821 +11512
- Misses 109448 116976 +7528
- Partials 19500 20442 +942
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Co-authored-by: tangenta <tangenta@126.com>
Co-authored-by: tangenta <tangenta@126.com>
@tangenta: Your lgtm message is repeated, so it is ignored. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
pkg/ddl/util/util.go
Outdated
resp, err = etcdCli.Get(childCtx, key) | ||
if err != nil { | ||
cancel() | ||
logutil.BgLogger().Warn("error when getting key revision", zap.String("category", "ddl"), zap.Error(err)) |
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 see that the log or error is usually used like this: failed to get key revision
or get key revision failed
. Also like line334, line332.
pkg/ddl/util/util.go
Outdated
cancel() | ||
|
||
if err != nil { | ||
logutil.BgLogger().Warn("error when performing compare-and-swap", zap.String("category", "ddl"), zap.Error(err)) |
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.
Ditto.
pkg/ddl/util/util.go
Outdated
cancel() | ||
|
||
if err != nil { | ||
logutil.BgLogger().Warn("error when performing compare-and-swap", zap.String("category", "ddl"), zap.Error(err)) |
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 to sleep like line335? Maybe we can return err == nil && txnResp.Succeeded
first. Then remaining two cases do the same(maybe the log is different).
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tangenta, zimulala The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #47060 and close #52335
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.