You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Jingguo Yao (Jira)" <ji...@apache.org> on 2020/03/29 02:26:00 UTC
[jira] [Created] (ZOOKEEPER-3773) Version argument should be
checked at the client side
Jingguo Yao created ZOOKEEPER-3773:
--------------------------------------
Summary: Version argument should be checked at the client side
Key: ZOOKEEPER-3773
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3773
Project: ZooKeeper
Issue Type: Improvement
Components: java client
Affects Versions: 3.5.5
Reporter: Jingguo Yao
Both setData and delete APIs has an argument version. The Javadoc for both APIs says:
{quote}The call will succeed if such a node exists, and the given version matches the
node's version (if the given version is -1, it matches any node's versions
{quote}
The Javadoc does not specify the behavior if version is less that -1. Here is the behavior I have observed:
# If the znode does not, KeeperException.NoNodeException is thrown.
# Otherwise, KeeperException.BadVersionException is thrown.
And the above behavior also holds for Op.Check, Op.Delete and Op.SetData with a version less than -1.
A check of the source code shows that both exception are resulted by checks on the server side. I suggest to do a check on the client. If version is less than -1, KeeperException.BadVersionException is thrown..
--
This message was sent by Atlassian Jira
(v8.3.4#803005)