EdColeman commented on code in PR #2737:
URL: https://github.com/apache/accumulo/pull/2737#discussion_r882706485
##########
server/base/src/main/java/org/apache/accumulo/server/conf/codec/VersionedProperties.java:
##########
@@ -106,10 +107,15 @@ public VersionedProperties(final int dataVersion, final
Instant timestamp,
* value should be used on data writes as the expected version. If the data
write fails do to an
* unexpected version, it signals that the node version has changed since
the instance was
* instantiated and encoded.
+ * <p>
+ * Implementation note: The data version is stored and returned is an
unsigned 32-bit integer
+ * value. Internally, ZooKeeper stores the value as a 32-bit signed value
that can roll-over and
+ * become negative. The can break applications that rely on the value to
always increase. This
+ * class ensures that the long returned will increase and will not be
negative.
Review Comment:
Second part first - yes, it will potentially rollover back to zero. To
prevent that would require an upstream change to ZooKeeper, but 2^32 versions
should last us a bit.
The update count in ZooBasedConfiguration expects that it will always
increase and with the recent changes that count is the data version count.
Specifically the code at
https://github.com/apache/accumulo/blob/a30980f8a99e3eef2aa828f591e8443818478c87/server/base/src/main/java/org/apache/accumulo/server/conf/ZooBasedConfiguration.java#L84
where the count is calculated with ` count += dataVersion`
--
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]