narendly commented on a change in pull request #519: Refine the rebalance scope 
calculating logic in the WAGED rebalancer.
URL: https://github.com/apache/helix/pull/519#discussion_r337865434
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/controller/changedetector/ResourceChangeSnapshot.java
 ##########
 @@ -72,6 +73,17 @@
     _changedTypes = new HashSet<>(dataProvider.getRefreshedChangeTypes());
     _instanceConfigMap = new HashMap<>(dataProvider.getInstanceConfigMap());
     _idealStateMap = new HashMap<>(dataProvider.getIdealStates());
+    for (String resourceName : _idealStateMap.keySet()) {
+      IdealState orgIdealState = _idealStateMap.get(resourceName);
+      if 
(orgIdealState.getRebalanceMode().equals(IdealState.RebalanceMode.FULL_AUTO)) {
+        IdealState trimmedIdealState = new 
IdealState(orgIdealState.getRecord());
+        // For FullAuto resources, map fields and list fields in the 
IdealStates is not user's input.
+        // So there is no need to detect any change in these 2 scopes.
+        trimmedIdealState.getRecord().setListFields(Collections.emptyMap());
+        trimmedIdealState.getRecord().setMapFields(Collections.emptyMap());
+        _idealStateMap.put(resourceName, trimmedIdealState);
 
 Review comment:
   Sure, what you are saying is correct. But ChangeDetector is a public 
component, and we can't make the assumption that the ListField and mapField are 
populated only by the controller. Users may actually use IdealState's list and 
map fields, and they are very much allowed to use ChangeDetector to build some 
custom logic around it (although that's certainly not how we intended). What do 
you think?

----------------------------------------------------------------
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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to