-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Reject watch request with -1 revision to prevent invalid resync behavior on uncompacted etcd and make rangeEvents safe against negative revision. #20693
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
0427f80 to
cf9b6a5
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files
... and 19 files with indirect coverage changes @@ Coverage Diff @@
## main #20693 +/- ##
==========================================
+ Coverage 69.20% 69.24% +0.04%
==========================================
Files 420 420
Lines 34794 34817 +23
==========================================
+ Hits 24078 24109 +31
+ Misses 9320 9317 -3
+ Partials 1396 1391 -5 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| if minRev < 0 { | ||
| minRev = 0 | ||
| } |
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.
Good catch!
This change makes sense.
cf9b6a5 to
9391a71
Compare
Reference: - etcd-io#20693 Signed-off-by: Chun-Hung Tseng <[email protected]>
Reference: - etcd-io#20693 Signed-off-by: Chun-Hung Tseng <[email protected]>
|
Just made #20663 ready to review! This was the robustness test case that Marek was referring to. |
Reference: - etcd-io#20693 Signed-off-by: Chun-Hung Tseng <[email protected]>
Reference: - etcd-io#20693 Signed-off-by: Chun-Hung Tseng <[email protected]>
Reference: - etcd-io#20693 Signed-off-by: Chun-Hung Tseng <[email protected]>
Reference: - etcd-io#20693 Signed-off-by: Chun-Hung Tseng <[email protected]>
9391a71 to
0c9169d
Compare
Reference: - etcd-io#20693 Signed-off-by: Chun-Hung Tseng <[email protected]>
7127584 to
5d8d14c
Compare
|
Added validation into grpc_proxy to fix it's test. |
…st negative revision Signed-off-by: Marek Siarkowicz <[email protected]>
5d8d14c to
afeab20
Compare
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fuweid, serathius, siyuanfoundation 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 |
|
/cherry-pick release-3.6 |
|
@serathius: new pull request created: #20707 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: #20693 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. |
Reference: - etcd-io#20693 Signed-off-by: Chun-Hung Tseng <[email protected]>
Continuing @henrybear327 work on #20663, using main...serathius:etcd:robustness-reproduable I managed to find a new watch issue.
tldr; Watch opened on rev
-1will break watch synchronization and cause unsynchronized watchers to skip events, breaking reliable/resumable.Found that opening a watch on revision
-1will be accepted and cause resync to break. There is no validation for negative revision in the watch code, instead revision is just check against>=compactRev. This is usually good enough, however if there was no compaction executed, etcd usescompactRevequal to -1. That means that request with revision -2 and lower are rejected, but revision -1 passes. The problem is that the watch with minRev equal-1will be passed torangeEventsfunction that doesn't support negative revisions. If negative revision is passed torangeEventsit will be converted into incorrect range, and return empty result. So all watches during resynchronization when there is watch with rev-1will not receive any events still will be marked as synchronized.This is a short term fix to mitigate issue. Long term I expect we should do something better than using
-1to mark etcd uncompacted. Using special values is never a good idea./cc @ahrtr @fuweid @siyuanfoundation