-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Avoid lowering revision of watchers in the future after restore #20281
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
Conversation
0536c4d to
a3ac879
Compare
Signed-off-by: Marek Siarkowicz <[email protected]>
a3ac879 to
cf0369e
Compare
| // Next retry of syncWatchers would try to resend the compacted watch response to w.ch | ||
| continue | ||
| } | ||
| w.minRev = curRev + 1 |
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.
The bug
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 only happens when watching a future revision?
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 might want to add such protection for all places which update w.minRev.
func (w *watcher) updateMinRev(rev) {
if rev > w.minRev {
w.minRev = rev
}
}
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.
Applying this everywhere might hide other kinds of bugs. I would prefer to cover the code with tests and then rewrite 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.
OK
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
... and 45 files with indirect coverage changes @@ Coverage Diff @@
## main #20281 +/- ##
==========================================
+ Coverage 68.96% 69.95% +0.98%
==========================================
Files 415 399 -16
Lines 34595 34027 -568
==========================================
- Hits 23860 23804 -56
+ Misses 9340 8838 -502
+ Partials 1395 1385 -10 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
ahrtr
left a comment
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
Thanks for the great work!
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahrtr, serathius 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 |
fuweid
left a comment
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
Good catch!
|
/cherry-pick release-3.6 |
|
@ivanvc: new pull request created: #20286 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-sigs/prow repository. |
|
/cherry-pick release-3.5 |
|
@serathius: #20281 failed to apply on top of branch "release-3.4": 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-sigs/prow repository. |
|
/cherry-pick release-3.5 |
|
@serathius: #20281 failed to apply on top of branch "release-3.5": 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-sigs/prow repository. |
|
Manual backport #20290 |
Fixes #20221
/cc @ahrtr @fuweid
The bug is in resync setting minRev. It assumes that watcher can only be behind, so after synchronizing it sets revision to current. However restore moves all watcher to unsynced, even those that are in the future. Those watchers don't get any events from resync, but their
minRevis overriden.