jiajunwang 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_r337859937
##########
File path:
helix-core/src/main/java/org/apache/helix/controller/rebalancer/waged/model/ClusterModelProvider.java
##########
@@ -97,27 +97,32 @@ public static ClusterModel
generateClusterModel(ResourceControllerDataProvider d
* Find the minimum set of replicas that need to be reassigned.
* A replica needs to be reassigned if one of the following condition is
true:
* 1. Cluster topology (the cluster config / any instance config) has been
updated.
- * 2. The baseline assignment has been updated.
- * 3. The resource config has been updated.
- * 4. The resource idealstate has been updated. TODO remove this condition
when all resource configurations are migrated to resource config.
- * 5. If the current best possible assignment does not contain the
partition's valid assignment.
+ * 2. The resource config has been updated.
+ * 3. If the current best possible assignment does not contain the
partition's valid assignment.
*
* @param replicaMap A map contains all the replicas grouped by
resource name.
* @param clusterChanges A map contains all the important metadata
updates that happened after the previous rebalance.
- * @param activeInstances All the instances that are alive and
enabled.
+ * @param activeInstances All the instances that are alive and
enabled according to the delay rebalance configuration.
+ * @param liveInstances All the instances that are alive.
* @param bestPossibleAssignment The current best possible assignment.
* @param allocatedReplicas Return the allocated replicas grouped by
the target instance name.
* @return The replicas that need to be reassigned.
*/
private static Set<AssignableReplica> findToBeAssignedReplicas(
Map<String, Set<AssignableReplica>> replicaMap,
Map<HelixConstants.ChangeType, Set<String>> clusterChanges, Set<String>
activeInstances,
- Map<String, ResourceAssignment> bestPossibleAssignment,
+ Set<String> liveInstances, Map<String, ResourceAssignment>
bestPossibleAssignment,
Map<String, Set<AssignableReplica>> allocatedReplicas) {
Set<AssignableReplica> toBeAssignedReplicas = new HashSet<>();
+
+ // newly connected nodes = changed liveInstance nodes & currently active
instances.
Review comment:
changed liveInstance nodes => changed liveInstance znodes
What we need is finding the new live nodes.
Another way I tried is using the detector to find added nodes. But then how
to find a node that is reconnected with a different session? In that case, we
also need to treat it as a newly added nodes in the rebalancer. So the current
method is the easiest way. Although there might be some false positive, it's
still better than missing one new node adding event.
----------------------------------------------------------------
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]