zookeeper icon indicating copy to clipboard operation
zookeeper copied to clipboard

ZOOKEEPER-4747: Add synchronous sync to ease synchronous call chains

Open kezhuw opened this issue 2 years ago • 1 comments

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

kezhuw avatar Sep 26 '23 16:09 kezhuw

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 path in sync.
  • ZOOKEEPER-4749(#2168) tries to unify zookeeper.request.timeout semantics between synchronous and asynchronous code. I believe we could easily refactor synchronous code using asynchronous apis once this is solved.

kezhuw avatar Aug 26 '24 06:08 kezhuw

@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.

anmolnar avatar Sep 18 '24 20:09 anmolnar

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). :-)

kezhuw avatar Sep 20 '24 12:09 kezhuw

Yes, we only have backward compatiblity rules, but not forward compatibility.

anmolnar avatar Sep 20 '24 18:09 anmolnar

Backported to branch-3.9 since it is a simple handy wrapper for asynchronous sync. Also, it touches no data part.

cc @anmolnar

kezhuw avatar Sep 21 '24 08:09 kezhuw