kafka icon indicating copy to clipboard operation
kafka copied to clipboard

KAFKA-10199: Expose read only task from state updater

Open cadonna opened this issue 3 years ago • 1 comments

The state updater exposes tasks that are in restoration to the stream thread. To ensure that the stream thread only accesses the tasks to read from the tasks without modifying any internal state, this PR introduces a read-only task that throws an exception if the caller tries to modify the internal state of a task.

This PR also returns read-only tasks from DefaultStateUpdater#getTasks().

Committer Checklist (excluded from commit message)

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

cadonna avatar Aug 09 '22 12:08 cadonna

The failures in DefaultStateUpdaterTest seems relevant?

guozhangwang avatar Aug 09 '22 23:08 guozhangwang

Failures are unrelated:

Build / JDK 8 and Scala 2.12 / org.apache.kafka.clients.consumer.CooperativeStickyAssignorTest.testLargeAssignmentAndGroupWithNonEqualSubscription()
Build / JDK 8 and Scala 2.12 / org.apache.kafka.clients.consumer.StickyAssignorTest.testLargeAssignmentAndGroupWithNonEqualSubscription()
Build / JDK 8 and Scala 2.12 / org.apache.kafka.connect.integration.BlockingConnectorTest.testBlockInConnectorStart

cadonna avatar Aug 12 '22 15:08 cadonna