zpinto commented on code in PR #2635:
URL: https://github.com/apache/helix/pull/2635#discussion_r1337905784
##########
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/WagedInstanceCapacity.java:
##########
@@ -54,7 +55,15 @@ public WagedInstanceCapacity(ResourceControllerDataProvider
clusterData) {
return;
}
for (InstanceConfig instanceConfig :
clusterData.getInstanceConfigMap().values()) {
- Map<String, Integer> instanceCapacity =
WagedValidationUtil.validateAndGetInstanceCapacity(clusterConfig,
instanceConfig);
+ Map<String, Integer> instanceCapacity;
+ try {
+ instanceCapacity =
WagedValidationUtil.validateAndGetInstanceCapacity(clusterConfig,
instanceConfig);
+ } catch (HelixException ex) {
+ // We don't want to throw exception here, it would be OK if no
resource is using Waged.
+ // Waged rebalancer will fail in later pipeline stage only for waged
resource. So it won't block other resources.
+ LOG.error("Failed to initialize instance capacity map. Instance
capacity map is not property set up", ex);
+ return;
Review Comment:
After looking at AssignableNode creation logic, it looks like there will be
an exception thrown when creating the ClusterModel for WAGED as
`validateAndGetInstanceCapacity` is called for that. This would mean that we
have a pipeline failure before we get to the logic that charges
_instanceCapacityMap.
That being said, I am not sure if we want to fail the pipeline in this
situation. Would it not be better to default required capacity keys to 0 if
nothing is present in InstanceConfig INSTANCE_CAPACITY_MAP or ClusterConfig
DEFAULT_INSTANCE_CAPACITY_MAP?
If we did that, we would not impact non-waged resources by failing the whole
pipeline and would also be able to continue assigning to other nodes with the
correct configurations.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]