Github user jiajunwang commented on a diff in the pull request:

    https://github.com/apache/helix/pull/89#discussion_r116559458
  
    --- Diff: helix-core/src/main/java/org/apache/helix/task/JobRebalancer.java 
---
    @@ -704,4 +712,30 @@ private PartitionAssignment(String instance, String 
state) {
           _state = state;
         }
       }
    +
    +  /**
    +   * Reset RUNNING/INIT tasks count in JobRebalancer
    +   */
    +  public static void resetActiveTaskCount(Collection<String> 
liveInstances, CurrentStateOutput currentStateOutput) {
    +    // init participant map
    +    for (String liveInstance : liveInstances) {
    +      participantActiveTaskCount.put(liveInstance, 0);
    +    }
    +    // Active task == init and running tasks
    +    
fillActiveTaskCount(currentStateOutput.getPartitionCountWithPendingState(TaskConstants.STATE_MODEL_NAME,
    --- End diff --
    
    Yes, at least based on task state model.
    And even there is not, it will be safer to add INIT check for pendingState.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to