Closed lpummer closed 4 months ago
Hello,
Thank you for the issue.
As far as I can tell, the protocol is correct, only a signed 32-bits integer can be used for the version
of a znode one wants to delete. The zxid
value can not be used as a parameter for delete()
, instead you should use the version
, which is dataVersion
in your zkCli output.
Yes, you're right. The implementation is correct. The ZooKeeper API is bad because you can zk.get version=1, another client can delete and replace the node with new contents now again having version=1, and then your delete on version=1 will not delete what you saw and intended.
Expected Behavior
zk.delete() should accept any version returned from ZnodeStat of an existing node
Actual Behavior
It seems to accept version arguments only within the bounds of signed 32-bit integers. Zxid can be unsigned 64 bit so it should accept at least that range. Since this is in the protocol serialization, it probably impacts any version argument.
Snippet to Reproduce the Problem
Logs with logging in DEBUG mode
N/A
Specifications
pip list
command: Package Versionappdirs 1.4.4 certifi 2020.12.5 cffi 1.15.1 chardet 4.0.0 cryptography 42.0.5 defusedxml 0.7.1 distlib 0.3.1 filelock 3.0.12 google-apputils 0.4.2 idna 2.10 kazoo 2.10.0 packaging 21.3 pip 20.2.1 protobuf 4.21.2 pycparser 2.21 pyparsing 3.0.9 python-dateutil 2.8.2 python-gflags 3.1.2 pytz 2022.1 requests 2.25.1 setuptools 53.0.0 six 1.15.0 urllib3 1.26.3 virtualenv 20.4.2 wheel 0.36.2