-
Notifications
You must be signed in to change notification settings - Fork 728
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
mcs: fix rule sync when meet "no rule left" and concurrency #7481
Conversation
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
[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. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7481 +/- ##
==========================================
- Coverage 74.65% 74.64% -0.01%
==========================================
Files 454 454
Lines 50142 50177 +35
==========================================
+ Hits 37432 37454 +22
- Misses 9385 9399 +14
+ Partials 3325 3324 -1
Flags with carried forward coverage won't be shown. Click here to find out more. |
env.RunTestInTwoModes(suite.checkDeleteAndUpdate) | ||
} | ||
|
||
func (suite *ruleTestSuite) checkDeleteAndUpdate(cluster *tests.TestCluster) { |
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.
Will it fail in the previous implementation?
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.
@@ -1330,5 +1330,5 @@ func checkRegionsReplicated(c *gin.Context) { | |||
c.String(http.StatusBadRequest, err.Error()) | |||
return | |||
} | |||
c.String(http.StatusOK, state) | |||
c.IndentedJSON(http.StatusOK, state) |
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.
What is the reason for this modification? Do we need to modify the corresponding API interface for the non-API mode?
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.
Avoid failure in JSON unmarshalling and maintain consistency with PD mode.
ruleWatcher *etcdutil.LoopWatcher | ||
groupWatcher *etcdutil.LoopWatcher |
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 still worry about whether two watchers will get the event disordered and overwrite the same rule.
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 will add a test about it. If necessary, I will merge these watchers.
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
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.
Mostly LGTM. Any manual test?
Signed-off-by: lhy1024 <admin@liudos.us>
PR needs rebase. 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. |
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
return false | ||
} | ||
} | ||
return true | ||
log.Info("respBundle", zap.Any("respBundle", respBundle), zap.Any("bundle", bundle)) |
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.
Will it log too much?
rw.pendingDeletion.kvs[path] = [2]string{groupID, ruleID} | ||
} | ||
|
||
func (rw *Watcher) tryFinishPendingDeletion() { |
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 worried about if the put and delete can be disordered. If so, the newly added rule might be deleted unexpectedly.
We will use replace this pr with txn. |
What problem does this PR solve?
Issue Number: Close #7418
What is changed and how does it work?
Check List
Tests
Release note