ZOOKEEPER-4747: Add synchronous sync to ease synchronous call chains
Previously, there is no synchronous sync so client has to convert asynchronous sync a bit to fit synchronous call chains. This is apparently unfriendly.
Besides above, in absent of ZOOKEEPER-22, we can't issue a fire and forget asynchronous sync to gain strong consistent. So it becomes crucial for client to have a convenient synchronous sync.
Refs: ZOOKEEPER-1167, ZOOKEEPER-4747
I plan to merge this now as all remaining review comments are either covered or cloud covered by separated jiras now:
- ZOOKEEPER-3414 proposes way to handle
pathinsync. - ZOOKEEPER-4749(#2168) tries to unify
zookeeper.request.timeoutsemantics between synchronous and asynchronous code. I believe we could easily refactor synchronous code using asynchronous apis once this is solved.
@kezhuw @eolivelli Are u sure you don't want this in 3.9 release line? I see it's new API, but since it's not breaking change, we might want to backport it.
Do we ever guarantee forward compatibility for released patch versions ?
If not, I am positive for this to be backported. The code is simple and the functionality is almost a simple wrapper for asynchronous version.
We just have encountered that netty breaks forward compatibility (https://github.com/apache/zookeeper/pull/1917#discussion_r1766935909). :-)
Yes, we only have backward compatiblity rules, but not forward compatibility.
Backported to branch-3.9 since it is a simple handy wrapper for asynchronous sync. Also, it touches no data part.
cc @anmolnar