Copilot commented on code in PR #22864:
URL: https://github.com/apache/kafka/pull/22864#discussion_r4525891432
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StoreChangelogReader.java:
##########
@@ -494,8 +503,9 @@ public Map<TopicPartition, Long>
logicalChangelogEndOffsets() {
public long restore(final Map<TaskId, Task> tasks) {
initializeChangelogs(tasks, registeredChangelogs());
- if (!activeRestoringChangelogs().isEmpty() && state ==
ChangelogReaderState.STANDBY_UPDATING) {
- throw new IllegalStateException("Should not be in standby updating
state if there are still un-completed active changelogs");
+ if (!activeRestoringChangelogsOf(tasks).isEmpty() && state ==
ChangelogReaderState.STANDBY_UPDATING) {
Review Comment:
The relaxed check allows paused active changelogs into the restoration loop,
which still passes a null task to `restoreChangelog` when their task is absent
from `tasks`. If `consumer.position()` times out or reports restoration
complete, the timeout handler or `recordRestorationProgress()` dereferences
that null task and terminates the updater thread despite the partition being
paused. Skip changelogs whose task is absent before restoration/completion
checks, and add a timeout-then-pause regression test.
--
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]