Skip to content

MINOR: allow removing a suspended task from task registry.#14555

Merged
lucasbru merged 3 commits intoapache:trunkfrom
lucasbru:suspended_state_updater_fix
Oct 17, 2023
Merged

MINOR: allow removing a suspended task from task registry.#14555
lucasbru merged 3 commits intoapache:trunkfrom
lucasbru:suspended_state_updater_fix

Conversation

@lucasbru
Copy link
Copy Markdown
Member

When we get a suspended task re-assigned in the eager rebalance protocol, we have to add the task back to the state updater so that it has a chance to catch up with its change log.

This was prevented by a check in Tasks, which disallows removing SUSPENDED tasks from the task registry. I couldn't find a reason why this must be an invariant of the task registry, so this weakens the check.

The error happens in the integration between TaskRegistry and TaskManager. However, this change anyway adds unit tests to more closely specify the intended behavior of the two modules.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

When we get a suspended task re-assigned in the eager rebalance
protocol, we have to add the task back to the state updater so
that it has a chance to catch up with its change log.

This was prevented by a check in `Tasks`, which disallows removing
SUSPENDED tasks from the task registry. I couldn't find a reason
why this must be an invariant of the task registry, so this
weakens the check.
@lucasbru lucasbru requested a review from cadonna October 16, 2023 12:46
@lucasbru lucasbru changed the title FIX: allow removing a suspended task from task registry. MINOR: allow removing a suspended task from task registry. Oct 16, 2023
Copy link
Copy Markdown
Member

@cadonna cadonna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucasbru Thanks for the PR!

Here my comment.

Copy link
Copy Markdown
Member

@cadonna cadonna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates, @lucasbru !

LGTM!

I have just one minor comment.

Comment thread streams/src/test/java/org/apache/kafka/streams/processor/internals/TasksTest.java Outdated
@lucasbru lucasbru merged commit e7e399b into apache:trunk Oct 17, 2023
@mjsax mjsax added the streams label Oct 17, 2023
AnatolyPopov pushed a commit to aiven/kafka that referenced this pull request Feb 16, 2024
)

When we get a suspended task re-assigned in the eager rebalance protocol, we have to add the task back to the state updater so that it has a chance to catch up with its change log.

This was prevented by a check in Tasks, which disallows removing SUSPENDED tasks from the task registry. I couldn't find a reason why this must be an invariant of the task registry, so this weakens the check.

The error happens in the integration between TaskRegistry and TaskManager. However, this change anyway adds unit tests to more closely specify the intended behavior of the two modules.

Reviewers: Bruno Cadonna <bruno@confluent.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants