}
}
}
if(exceptions.size() > 0) {
throw new VoldemortRebalancingException("Got exceptions from nodes "
+ exceptions.keySet());
}
/*
* If everything went smoothly, update the version of the
* cluster metadata
*/
if(changeClusterMetadata) {
try {
metadataMgmtOps.updateMetadataversion(CLUSTER_VERSION_KEY);
} catch(Exception e) {
logger.info("Exception occurred while setting cluster metadata version during Rebalance state change !!!");
}
}
} catch(Exception e) {
if(rollback) {
logger.error("Got exceptions from nodes " + exceptions.keySet()
+ " while changing state. Rolling back state on "
+ completedNodeIds);
// Rollback changes on completed nodes
for(int completedNodeId: completedNodeIds) {
try {
individualStateChange(completedNodeId,
existingCluster,
existingStoreDefs,
stealerNodeToRebalanceTasks.get(completedNodeId),
swapRO,
changeClusterMetadata,
changeRebalanceState,
true);
} catch(Exception exception) {
logger.error("Error while reverting back state change for completed node "
+ completedNodeId,
exception);
}
}
} else {
logger.error("Got exceptions from nodes " + exceptions.keySet()
+ " while changing state");
}
throw new VoldemortRebalancingException("Got exceptions from nodes "
+ exceptions.keySet()
+ " while changing state",
Lists.newArrayList(exceptions.values()));
}