vamossagar12 commented on code in PR #11433:
URL: https://github.com/apache/kafka/pull/11433#discussion_r1152707931


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java:
##########
@@ -342,7 +379,18 @@ public void handleAssignment(final Map<TaskId, 
Set<TopicPartition>> activeTasks,
 
         maybeThrowTaskExceptions(taskCloseExceptions);
 
-        createNewTasks(activeTasksToCreate, standbyTasksToCreate);
+        final Collection<Task> newActiveTasks = 
createNewTasks(activeTasksToCreate, standbyTasksToCreate);
+        final Set<Task> activeTasksNeedCommit;
+        // Find new active tasks which need commit.
+        if (newActiveTasks == null || newActiveTasks.isEmpty()) {
+            activeTasksNeedCommit = new HashSet<>();
+        } else {
+            activeTasksNeedCommit = 
newActiveTasks.stream().filter(Task::commitNeeded).collect(Collectors.toSet());

Review Comment:
   I see. I have modified this check accordingly, ie now I am checking if there 
are newly created active tasks and there's an in-flight txn, then look to 
commit tasks. Since `threadProducer()` works only for EOS-v2, this fix 
implicitly applies only for that version.



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

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to