jiajunwang commented on a change in pull request #941: Fix unexpceted partition 
movements in the CrushEd strategy.
URL: https://github.com/apache/helix/pull/941#discussion_r407648779
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/controller/rebalancer/AbstractRebalancer.java
 ##########
 @@ -417,4 +417,25 @@ public int compare(String ins1, String ins2) {
       return p1.compareTo(p2);
     }
   }
+
+  // This is for a backward compatible workaround to fix
+  // https://github.com/apache/helix/issues/940.
+  // TODO: remove the workaround once we are able to apply the simple fix 
without majorly
+  // TODO: impacting user's clusters.
+  protected List<String> getStablePartitionList(ResourceControllerDataProvider 
clusterData,
+      IdealState currentIdealState) {
+    List<String> partitions =
+        
clusterData.getStablePartitionList(currentIdealState.getResourceName());
+    Set<String> currentPartitionSet = currentIdealState.getPartitionSet();
+    if (partitions.size() != currentPartitionSet.size() || !currentPartitionSet
+        .containsAll(partitions)) {
 
 Review comment:
   I thought about this, but the other ways are not safe or creating too many 
additional dependencies. For example, if IS has not been changed, then we don't 
update the partition lists.
   But there is a big assumption there. Doing that might cause some bugs in the 
future.
   
   I don't have a better idea now. Please suggest.

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