kezhuw commented on code in PR #478:
URL: https://github.com/apache/curator/pull/478#discussion_r1311408914
##########
curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedValue.java:
##########
@@ -196,7 +196,7 @@ public boolean trySetValue(VersionedValue<byte[]> previous,
byte[] newValue) thr
private void updateValue(int version, byte[] bytes) {
while (true) {
VersionedValue<byte[]> current = currentValue.get();
- if (current.getVersion() >= version) {
+ if (current.getVersion() >= version && version !=
Integer.MIN_VALUE) {
Review Comment:
It is
[checkAndIncVersion](https://github.com/apache/zookeeper/blob/03a36d08e257c43e8377e5549d5524805fc6b8bb/zookeeper-server/src/main/java/org/apache/zookeeper/server/PrepRequestProcessor.java#L737)
in ZooKeeper side. When the `expectedVersion` is `-1`, it means `setData`
blindly.
In Curator side, that is when `getVersionedValue` reports `-1`, the next
`trySetValue` will ship `-1` as `expectedVersion` to server which is apparently
not what we want.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]