[
https://issues.apache.org/jira/browse/ZOOKEEPER-3289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16777681#comment-16777681
]
TisonKun commented on ZOOKEEPER-3289:
-------------------------------------
After digging our codes, I think the root of this issue isn't code snippet
above. Since we update {{DataTree}} after the request succeeded.
Assume we execute the follow statements
{code:java}
ZooKeeper zk = ...;
zk.multi(Arrays.asList(
Op.check(path1, -1),
Op.delete(path2, -1)));
{code}
If path1 or path2 didn't exist, when we executed
{{PrepRequestProccessor#pRequest}} in {{PrepRequestProccessor#L804}}, it
processed {{KeeperException.NoNodeException}} which contained path info.
However, we generated {{ErrorTxn}} which only contains {{err}} field
represented error code. Maybe a reasonable resolution is extend {{ErrorTxn}} to
contain path info or a general {{data}} byte array.
> Throw KeeperException with path in DataTree operations
> ------------------------------------------------------
>
> Key: ZOOKEEPER-3289
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3289
> Project: ZooKeeper
> Issue Type: Improvement
> Components: server
> Affects Versions: 3.5.4, 3.4.13
> Reporter: TisonKun
> Priority: Major
> Fix For: 3.5.5, 3.4.14
>
>
> Currently, if ZooKeeper delete a znode that does not exist. It throws a
> {{KeeperException.NoNodeException}} without path message. It causes
> difficulty when user debug with ZooKeeper. For example,
> Assume we try to do a transaction(with Curator encapsulation)
> {code:java}
> client.inTransaction()
> .check().forPath(path1).and()
> .delete().forPath(path2).and()
> .commit()
> {code}
> if the statement throw an exception {{KeeperException.NoNodeException}}
> without path information, we can hardly know that it failed at {{check}} or
> {{delete}}.
> Thus I propose throws KeeperException with path in DataTree operations. We
> can achieve this without burden.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)