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.
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
ZOOKEEPER-4466: Support different watch modes on same path #1859
ZOOKEEPER-4466: Support different watch modes on same path #1859
Changes from 1 commit
b65852e
cc74acd
5355029
6e8cd81
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@kezhuw Can you explain a bit why this change is correct?
It seems that previously,
containsWatcher (path, watcher)
will betrue
if any parent of the path has a persistent recursive watch.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 is no true though it might intend to do so. Two cases for old code:
return true
will hold.watcherMode
will beWatcherMode.STANDARD
, noreturn true
will hold:return true
will not hold as it only apply for leaf node where there is no such watch.return true
will not hold asWatcherMode.STANDARD
is no recursive.So my change has same behavior as old code and also same to when it was introduced. I think this behavior meets what
OpCode.checkWatches
expects which is the sole client visible call to this method. Disregard cheating behaviour ofZooKeeper.removeWatches
, removing sub nodes from recursive watching sounds quirk as similar one I saw in ZOOKEEPER-4471.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.
Thanks for your explanation! I get it now :)