zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zili Chen <wander4...@gmail.com>
Subject [RFR] ZOOKEEPER-3290: Throw detailed KeeperException when multi-op failed
Date Sat, 24 Aug 2019 20:19:08 GMT
Hi ZooKeepers,

ZOOKEEPER-3290 has been revived and here is its pull request[1].

Basically it extends field of ErrorTxn/ErrorResponse/ErrorResult to
reflect accurate path info when a transaction failed. For example,
assumed we do check1(path1)-create1(path2) and fail with
NoNodeException, previously we don't know it is because absence of
path1? or path2? or parent of one of them? Now we will throw a
KeeperException with the accurate path that cause it.

For instance,

    ZooKeeper zk = new ZooKeeper(...);

    zk.multi(List.of(
        Op.check("/path1", -1),
        Op.create("/path2", ...)));

formerly throw with

Exception in thread "main"
org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode =
NoNode

but now

Exception in thread "main"
org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode =
NoNode for /path1

Theoretically Jute is fine with this change so that we don't need to worry
about compatibility issue. Please checkout the branch if you are interested
in this feature.

Any feedback includes things work as expected is welcome.

Best,
tison.

[1] https://github.com/apache/zookeeper/pull/839

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message