Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.6.3, 3.8.0, 3.7.1
Description
ClientCnxn strips off chrootPath for notifications. This strip could break "/zookeeper/config" to illegal zookeeper path(aka. not start with "/") and fail zookeeper client due to index out of bound exception in PathParentIterator.next.
// convert from a server path to a client path if (chrootPath != null) { String serverPath = event.getPath(); if (serverPath.compareTo(chrootPath) == 0) { event.setPath("/"); } else if (serverPath.length() > chrootPath.length()) { event.setPath(serverPath.substring(chrootPath.length())); } else { LOG.warn("Got server path {} which is too short for chroot path {}.", event.getPath(), chrootPath); } }
I think we could make this strip similar to c client version sub_string and warns only for not "/zookeeper" nodes.
I found this issue in reproducing CURATOR-593 and CURATOR-611. And the consequences are different in 3.6.3 and before.
Attachments
Issue Links
- blocks
-
CURATOR-593 EnsembleTracker "configToConnectionString" method doesn't include zookeeper chroot
- Resolved
-
CURATOR-611 EnsembleTracker not appending the chroot node when setting the new connection string
- Closed
- is related to
-
ZOOKEEPER-4601 Define getConfig Watcher behavior in chroot ZooKeeper
- Resolved
- relates to
-
ZOOKEEPER-838 Chroot is an attribute of ClientCnxn
- Resolved
- links to