I met this issue again when working on Pravega[1], a project using
ZooKeeper.

I think it is nice to have that we throw the exactly path that cause the
multi-op fails.

Could you help to review the pull request?

Best,
tison.

[1] https://github.com/pravega/pravega/pull/4140#discussion_r322096138


Zili Chen <wander4...@gmail.com> 于2019年8月25日周日 上午4:19写道:

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

Reply via email to