Hi, Currently, "path" has no meaning in "ZooKeeper.sync()". ZOOKEEPER-3414[1] proposes to throw "NoNodeException" when "path" does not exist. But it is not delivered. I used to use "/".
Regarding the "callback", it is crucial in asynchronous, as "ZooKeeper.sync" could fail due to connection issues while following reads could succeed after reconnection. ZOOKEEPER-4747[2] introduces a synchronous version to ease the callback handle. [1]: https://issues.apache.org/jira/browse/ZOOKEEPER-3414 [2]: https://issues.apache.org/jira/browse/ZOOKEEPER-4747 Best, Kezhu Wang On Fri, Mar 28, 2025 at 9:38 PM David Smiley <[email protected]> wrote: > > The javadocs on ZooKeeper.sync() are extremely sparse; nobody would > understand this by only looking at it. I've looked at the programmer's > guide, which actually explains its use. The callback appears pointless? > Does the semantics of "sync" apply only to reading the path and its > children list, or does it apply recursively to descendants beneath this > path? > > ~ David Smiley > Apache Lucene/Solr Search Developer > http://www.linkedin.com/in/davidwsmiley
