alirezazamani commented on a change in pull request #1422:
URL: https://github.com/apache/helix/pull/1422#discussion_r500478114



##########
File path: 
helix-core/src/main/java/org/apache/helix/task/AbstractTaskDispatcher.java
##########
@@ -122,30 +122,37 @@ public void updatePreviousAssignedTasksStatus(
       Set<Integer> donePartitions = new TreeSet<>();
       for (int pId : pSet) {
         final String pName = pName(jobResource, pId);
-        TaskPartitionState currState = 
updateJobContextAndGetTaskCurrentState(currStateOutput,
+        TaskPartitionState currState = getTaskCurrentState(currStateOutput,
             jobResource, pId, pName, instance, jobCtx, jobTgtState);
 
-        if (!instance.equals(jobCtx.getAssignedParticipant(pId))) {
-          LOG.warn(
-              "Instance {} does not match the assigned participant for pId {} 
in the job context. Skipping task scheduling.",
-              instance, pId);
-          continue;
-        }
-
         // Check for pending state transitions on this (partition, instance). 
If there is a pending
         // state transition, we prioritize this pending state transition and 
set the assignment from
         // this pending state transition, essentially "waiting" until this 
pending message clears
+        // If there is a pending message, we should not continue to update the 
context because from
+        // controller prospective, state transition has not been completed yet 
if pending message
+        // still existed.
+        // If context gets updated here, controller might remove the job from 
RunTimeJobDAG which
+        // can cause the task's CurrentState not being removed when there is a 
pending message for
+        // that task.
         Message pendingMessage =
             currStateOutput.getPendingMessage(jobResource, new 
Partition(pName), instance);
-        if (pendingMessage != null && 
!pendingMessage.getToState().equals(currState.name())) {

Review comment:
       For 1, it is not related to the deletion of the job. The issue is once 
you mark the last task of the job in the jobContext as completed, then you 
remove this job from RunTimeJobDag in jobDispatcher. Then next pipeline you 
will not even see this job in your RuntimeJobDAG. Now there is no way to drop 
the current state until JobConfig existed. After JobConfig is removed, then the 
code you pasted should take care of it.




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



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

Reply via email to