apurtell commented on a change in pull request #809: HBASE-23261 : Processing
ZK BadVersionException during node transition
URL: https://github.com/apache/hbase/pull/809#discussion_r344834402
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZKSplitTransactionCoordination.java
##########
@@ -222,9 +229,21 @@ public void completeSplitTransaction(final
RegionServerServices services, Region
// Tell master about split by updating zk. If we fail, abort.
if (coordinationManager.getServer() != null) {
try {
- zstd.setZnodeVersion(transitionSplittingNode(parent.getRegionInfo(),
a.getRegionInfo(),
- b.getRegionInfo(), coordinationManager.getServer().getServerName(),
zstd,
- RS_ZK_REGION_SPLITTING, RS_ZK_REGION_SPLIT));
+ int newNodeVersion = -1;
+ for (int i = 0; i < SPLIT_WAIT_TIMEOUT; i++) {
+ newNodeVersion = transitionSplittingNode(parent.getRegionInfo(),
a.getRegionInfo(),
Review comment:
transitionSplittingNode calls ZKAssign.transitionNode which has this check
early in the method:
// Verify it is the expected version
if (expectedVersion != -1 && stat.getVersion() != expectedVersion) {
LOG.warn(zkw.prefix("Attempt to transition the " +
"unassigned node for " + encoded +
" from " + beginState + " to " + endState + " failed, " +
"the node existed but was version " + stat.getVersion() +
" not the expected version " + expectedVersion));
return -1;
}
This would be expected to fail, right? We have not [re-read the
znode](https://zookeeper.apache.org/doc/r3.4.14/api/org/apache/zookeeper/ZooKeeper.html#getData-java.lang.String-boolean-org.apache.zookeeper.data.Stat-).
We have not updated expectedVersion with the latest znode version. This will
fail each iteration until we reach SPLIT_WAIT_TIMEOUT and throw an exception.
----------------------------------------------------------------
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