-
Notifications
You must be signed in to change notification settings - Fork 7.3k
ZOOKEEPER-4472: Remove persistent watches individually #2006
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-4472: Remove persistent watches individually #2006
Conversation
eolivelli
left a comment
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.
+1
cd11e2b to
cecc2ea
Compare
|
ReadOnlyModeTest.testConnectionEvents failed. There are candidates to fix this #1667 and #1896. |
ZOOKEEPER-4466 supports different watch modes one same path, but there are no corresponding `WatcherType`s for persistent watches. Client has to resort to `WatcherType.Any` to remove them. This could accidently interrupt other watches. This PR adds `WatcherType.Persistent` and `WatcherType.PersistentRecursive` to remove persistent watches individually.
421d0ab to
83d3ea9
Compare
| synchronized (childWatches) { | ||
| containsWatcher = contains(path, watcher, childWatches); | ||
| } | ||
|
|
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 agree on this direction that it delivers more reasonable behaviors. But it can somehow still a user-facing manner changes. Maybe we need a release note to describe it.
I'll check the final logic tomorrow and give a review result :D
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.
Here are my findings:
containsWatcheris package private and used solely byZKWatchManager::removeWatcher.removeWatcherenforces more stringentNoWatcherExceptioncheck thancontainsWatcher.
So, we are in lucking path that partially removing WatcherType::Data from AddWatchMode::Persistent is an error even it is permitted by server side(a.k.a rc is 0) and containsWatcher.
I pushed a test commit for this. I also pushed tests in kezhuw@8c35fce before ZOOKEEPER-4466. All these tests result in NOWATCHER when removing WatcherType::Data from AddWatchMode::Persistent.
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 have add "Release Note" to ZOOKEEPER-4466, ZOOKEEPER-4471 and ZOOKEEPER-4472.
Is that sufficient for us ? @eolivelli @tisonkun @anmolnar
tisonkun
left a comment
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.
Thank you! LGTM now.
|
Merging... |
|
For the release notes the release manager should write it in the news page. |
* ZOOKEEPER-4472: Remove persistent watches individually ZOOKEEPER-4466 supports different watch modes one same path, but there are no corresponding `WatcherType`s for persistent watches. Client has to resort to `WatcherType.Any` to remove them. This could accidently interrupt other watches. This PR adds `WatcherType.Persistent` and `WatcherType.PersistentRecursive` to remove persistent watches individually. * Assert removing WatcherType::Data from AddWatchMode::Persistent is impossible * fixup! Assert removing WatcherType::Data from AddWatchMode::Persistent is impossible
…53) * ZOOKEEPER-4472: Remove persistent watches individually ZOOKEEPER-4466 supports different watch modes one same path, but there are no corresponding `WatcherType`s for persistent watches. Client has to resort to `WatcherType.Any` to remove them. This could accidently interrupt other watches. This PR adds `WatcherType.Persistent` and `WatcherType.PersistentRecursive` to remove persistent watches individually. * Assert removing WatcherType::Data from AddWatchMode::Persistent is impossible * fixup! Assert removing WatcherType::Data from AddWatchMode::Persistent is impossible Co-authored-by: Kezhu Wang <[email protected]>
* ZOOKEEPER-4472: Remove persistent watches individually ZOOKEEPER-4466 supports different watch modes one same path, but there are no corresponding `WatcherType`s for persistent watches. Client has to resort to `WatcherType.Any` to remove them. This could accidently interrupt other watches. This PR adds `WatcherType.Persistent` and `WatcherType.PersistentRecursive` to remove persistent watches individually. * Assert removing WatcherType::Data from AddWatchMode::Persistent is impossible * fixup! Assert removing WatcherType::Data from AddWatchMode::Persistent is impossible
ZOOKEEPER-4466 supports different watch modes one same path, but there are no corresponding
WatcherTypes for persistent watches. Client has to resort toWatcherType.Anyto remove them. This could accidently interrupt other watches.This PR adds
WatcherType.PersistentandWatcherType.PersistentRecursiveto remove persistent watches individually.Besides above, this pr bases on #1998.