xyuanlu commented on code in PR #2969:
URL: https://github.com/apache/helix/pull/2969#discussion_r1866592043
##########
helix-core/src/main/java/org/apache/helix/controller/stages/CurrentStateComputationStage.java:
##########
@@ -356,6 +356,11 @@ void handleResourceCapacityCalculation(ClusterEvent event,
ResourceControllerDat
CurrentStateOutput currentStateOutput) {
Map<String, Resource> resourceMap =
event.getAttribute(AttributeName.RESOURCES.name());
if (skipCapacityCalculation(cache, resourceMap, event)) {
+ // Ensure instance capacity is null if there are no resources. This
prevents using a stale map when all resources
+ // are removed and then a new resource is added.
+ if (resourceMap == null || resourceMap.isEmpty()) {
Review Comment:
nit: can we merge the 2 if?
--
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]