hanm commented on a change in pull request #1172: ZOOKEEPER-3594: Ability to
skip proposing requests with error transactions
URL: https://github.com/apache/zookeeper/pull/1172#discussion_r360614362
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
##########
@@ -561,7 +561,11 @@ public SessionTracker getSessionTracker() {
}
long getNextZxid() {
- return hzxid.incrementAndGet();
+ return hzxid.get() + 1;
+ }
+
+ void incrementZxid() {
Review comment:
another idea - instead of having this to increase the zxid we can instead
have a decrementZxid, which will only be called if we have an error
transaction. By doing that, we can keep the existing implementation of
`getNextZxid `. This way we only decrement zxid for error transactions; for
usual transactions we only call `getNextZxid ` once (as opposed to the call
both `getNextZxid ` and `incrementZxid `).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services