-
Notifications
You must be signed in to change notification settings - Fork 10.1k
client/v3/watch: should panic if receives unexpected revision #20263
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
base: main
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fuweid 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 |
/test pull-etcd-e2e-amd64 |
verify.Verify(func() { | ||
if w.startRev > 0 { | ||
for _, ev := range wr.Events { | ||
if ev.Kv.ModRevision < w.startRev { | ||
panic(fmt.Sprintf("Event.ModRevision(%d) is less than the w.startRev(%d) for watchID: %d", ev.Kv.ModRevision, w.startRev, w.id)) | ||
} | ||
} | ||
} | ||
}) | ||
|
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 strongly suggest to keep this commit in your test. So that we can exclude the server side issue. You also need to keep the field startRev
in watcher
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.
agree
client/v3/watch.go
Outdated
@@ -855,6 +855,9 @@ func (w *watchGRPCStream) serveSubstream(ws *watcherStream, resumec chan struct{ | |||
nextRev = wr.Events[len(wr.Events)-1].Kv.ModRevision + 1 | |||
} | |||
|
|||
if nextRev < ws.initReq.rev { | |||
fmt.Println("oops --------> initReq.rev(", ws.initReq.rev, ") vs nextRev(", nextRev, ")") |
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.
Please also print whether there is any Events in the watch response. If yes, print the biggest ModRevision
?
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 update it.
Just to double check, you can only reproduce it after reverting the fix #20229? In other words, can you reproduce it without reverting the fix? The fix might be exactly the fix to both issues.
|
/retest |
8ee1ea3
to
d4f8e69
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
... and 22 files with indirect coverage changes @@ Coverage Diff @@
## main #20263 +/- ##
==========================================
+ Coverage 68.72% 69.02% +0.30%
==========================================
Files 413 415 +2
Lines 34529 34601 +72
==========================================
+ Hits 23730 23885 +155
+ Misses 9414 9322 -92
- Partials 1385 1394 +9 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Signed-off-by: Wei Fu <fuweid89@gmail.com>
/retest |
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.