ZOOKEEPER-4472: Remove persistent watches individually #2006
Conversation
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.
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.
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.
I have add "Release Note" to ZOOKEEPER-4466, ZOOKEEPER-4471 and ZOOKEEPER-4472.
Is that sufficient for us ? @eolivelli @tisonkun @anmolnar
|
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 <kezhuw@gmail.com>
* 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.