Skip to content
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

Validate revisions between progress notify #17810

Merged

Conversation

serathius
Copy link
Member

@serathius serathius commented Apr 16, 2024

Validate delivery of events between progress notifies. #17771 prevented empty streams for revision ranges between watch requiring revision and progress notify. This missed one more case, ranges between two progress notifies. This PR extends reliable validation to validate whole ranges.

Simplifying bookmarkable to just validate revision order between events
and progress notifies.

Use reliable to validate if events are missing, but still report
broken resumable if first event after revision is missing. It's easier
to have one place that validates event slices.

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@serathius serathius force-pushed the robustness-revisions-between-progress branch 2 times, most recently from 7029f80 to 8eb47aa Compare April 16, 2024 17:37
@serathius serathius marked this pull request as ready for review April 16, 2024 17:37
@serathius
Copy link
Member Author

@serathius serathius force-pushed the robustness-revisions-between-progress branch 3 times, most recently from 7671845 to cb76098 Compare April 16, 2024 20:50
@serathius serathius marked this pull request as draft April 16, 2024 20:51
@serathius
Copy link
Member Author

serathius commented Apr 16, 2024

Marking as draft found a new edge case where request revision can be higher than bookmark.

@serathius serathius force-pushed the robustness-revisions-between-progress branch from cb76098 to 50ecda4 Compare April 17, 2024 18:04
@serathius serathius marked this pull request as ready for review April 17, 2024 18:05
@serathius
Copy link
Member Author

err = validateBookmarkable(lg, r)
if err != nil {
return err
}
if eventHistory != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although it is trivial, can you add a test case where eventHistory is empty but there are multiple progress notify events?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A passing case or a failing one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a passing case. And the test case for 2 progressNotify responses with the wrong rev order is also missing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

@serathius serathius force-pushed the robustness-revisions-between-progress branch 3 times, most recently from 327987a to ad23f87 Compare April 18, 2024 15:06
@serathius
Copy link
Member Author

/retest

Simplifying bookmarkable to just validate revision order between events
and progress notifies.

Use reliable to validate if events are missing, but still report
broken resumable if first event after revision is missing. It's easier
to have one place that validates event slices.

Signed-off-by: Marek Siarkowicz <[email protected]>
@serathius serathius force-pushed the robustness-revisions-between-progress branch from ad23f87 to 964680c Compare April 19, 2024 08:43
@serathius
Copy link
Member Author

ping @ahrtr @MadhavJivrajani @fuweid

@ahrtr
Copy link
Member

ahrtr commented Apr 20, 2024

defer to @MadhavJivrajani @siyuanfoundation @ArkaSaha30 @fuweid to review robustness test PRs.

if index == len(events) {
continue
for _, watch := range report.Watch {
firstRev := firstExpectedRevision(watch)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to have firstRev > lastRev when there is only one response and it's progress notification?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, It's covered in test Bookmarkable - progress notification lower than watch request - pass.

Client can request to watch from higher revision than clusters is on. This means that progress notifies will come will lower revision than watch request.

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@serathius serathius merged commit a097a3b into etcd-io:main Apr 21, 2024
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants