virajjasani 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_r344581570
##########
File path:
hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java
##########
@@ -868,7 +868,20 @@ public static int transitionNode(ZooKeeperWatcher zkw,
HRegionInfo region,
try {
rt = RegionTransition.createRegionTransition(
endState, region.getRegionName(), serverName, payload);
- if(!ZKUtil.setData(zkw, node, rt.toByteArray(), stat.getVersion())) {
+ boolean isDataSet;
+ try {
+ isDataSet = ZKUtil.setData(zkw, node, rt.toByteArray(),
stat.getVersion());
+ } catch (KeeperException.BadVersionException e) {
+ // handling specific failure - see HBASE-23261
+ // for other state changes, callers have some logic to handle Exception
+ if (!EventType.RS_ZK_REQUEST_REGION_SPLIT.equals(endState)) {
Review comment:
This specific condition is added to ensure we don't affect other
transitioning scenarios.
e.g. transitionSplittingNode
[here](https://github.com/apache/hbase/blob/f7ca22fd4890a952fcf8fa66254fe08567bf2306/hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZKSplitTransactionCoordination.java#L225)
would return -1 if we don't have this specific case and I am not sure if that
would be handled well.
Somehow, I also feel it's good to have this BVE handling available for all
cases. Let me try some more testing and if seems good, we can remove special
case handling.
----------------------------------------------------------------
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