arnabnandy7 commented on code in PR #22864:
URL: https://github.com/apache/kafka/pull/22864#discussion_r4527049714


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StoreChangelogReader.java:
##########
@@ -574,9 +584,12 @@ private void pauseResumePartitions(final Map<TaskId, Task> 
tasks,
                                        final Set<TopicPartition> 
restoringChangelogs) {
         if (state == ChangelogReaderState.ACTIVE_RESTORING) {
             updatePartitionsByType(tasks, restoringChangelogs, 
TaskType.ACTIVE);
-        }
-        if (state == ChangelogReaderState.STANDBY_UPDATING) {
+        } else {
             updatePartitionsByType(tasks, restoringChangelogs, 
TaskType.STANDBY);
+            final Set<TopicPartition> activeRestoringChangelogs = 
activeRestoringChangelogs();
+            if (!activeRestoringChangelogs.isEmpty()) {
+                restoreConsumer.pause(activeRestoringChangelogs);

Review Comment:
   Added a comment explaining that paused active tasks retain their registered 
restoring changelogs, so those partitions must be paused explicitly while 
updating standbys.



##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/DefaultStateUpdaterTest.java:
##########
@@ -1399,9 +1432,11 @@ public void shouldIdleWhenAllTasksPaused() throws 
Exception {
     public void shouldResumeStandbyTask() throws Exception {
         final StandbyTask task = standbyTask(TASK_0_0, 
Set.of(TOPIC_PARTITION_A_0)).inState(State.RUNNING).build();
         shouldResumeStatefulTask(task);
+        assertEquals(Optional.empty(), stateUpdater.fatalException());

Review Comment:
   Moved the fatal-exception assertion after `shutdown(...)`, ensuring the 
resumed standby transition has completed before the assertion runs.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to