fix: update watch_ctx.revision to avoid multiple resyncs#12021
Merged
Conversation
membphis
reviewed
Mar 11, 2025
membphis
left a comment
Member
There was a problem hiding this comment.
is it easy to add a test case for this case?
Contributor
Author
not easy because it requires restarting etcd and deleting data which is outside the scope of test cases. I tried mocking etcd related functions and it got really complicated so I decided to halt the efforts in that direction. But this can be tested manually with reproduction steps. |
membphis
approved these changes
Mar 12, 2025
nic-chen
approved these changes
Mar 12, 2025
nic-chen
left a comment
Member
There was a problem hiding this comment.
I also did a simple test, and the previous error log did not appear again
nic-6443
approved these changes
Mar 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes # (issue)
Recently this PR was merged #12015
Although it fixed the original issue, it didn't update revision on the watch context which caused resync to happen again and again. This resync will keep happening until the revision will catch up to the watch_ctx.rev.
This change updates watch_ctx.revision to the last observed revision so that once resync takes place it doesn't happen again and again.
Checklist