sunm2n commented on code in PR #24346:
URL: https://github.com/apache/kafka/pull/24346#discussion_r4667389431


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/DefaultStateUpdater.java:
##########
@@ -369,21 +369,30 @@ private void handleFatalThrowable(final Throwable 
throwable) {
         private void handleTaskCorruptedException(final TaskCorruptedException 
taskCorruptedException) {
             log.info("Encountered task corrupted exception: ", 
taskCorruptedException);
             final Set<TaskId> corruptedTaskIds = 
taskCorruptedException.corruptedTasks();
-            final Set<Task> corruptedTasks = new HashSet<>();
+            final Set<Task> corruptedUpdatingTasks = new HashSet<>();
+            final Set<Task> corruptedPausedTasks = new HashSet<>();
             final Set<TopicPartition> changelogsOfCorruptedTasks = new 
HashSet<>();
             for (final TaskId taskId : corruptedTaskIds) {
-                final Task corruptedTask = updatingTasks.get(taskId);
-                if (corruptedTask == null) {
-                    throw new IllegalStateException("Task " + taskId + " is 
corrupted but is not updating. " + BUG_ERROR_MESSAGE);
+                final Task corruptedTask;
+                if (updatingTasks.containsKey(taskId)) {
+                    corruptedTask = updatingTasks.get(taskId);
+                    corruptedUpdatingTasks.add(corruptedTask);
+                } else if (pausedTasks.containsKey(taskId)) {

Review Comment:
   Nit: could we add a short comment explaining how a paused task can appear in 
this exception?
   ```suggestion
                   } else if (pausedTasks.containsKey(taskId)) {
                       // A paused task's changelog partitions can still be 
assigned to the restore consumer,
                       // so an invalid offset for one of them can result in a 
TaskCorruptedException naming this task.
   ```



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