You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Guozhang Wang (JIRA)" <ji...@apache.org> on 2019/02/22 19:07:00 UTC
[jira] [Updated] (KAFKA-7985) Cleanup AssignedTasks / AbstractTask
logic
[ https://issues.apache.org/jira/browse/KAFKA-7985?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Guozhang Wang updated KAFKA-7985:
---------------------------------
Component/s: streams
> Cleanup AssignedTasks / AbstractTask logic
> ------------------------------------------
>
> Key: KAFKA-7985
> URL: https://issues.apache.org/jira/browse/KAFKA-7985
> Project: Kafka
> Issue Type: Improvement
> Components: streams
> Reporter: Guozhang Wang
> Priority: Major
>
> Today the life time of a task is:
> created -> [initializeStateStores] ->
> restoring (writes to the initialized state stores) -> [initializeTopology] ->
> running -> [closeTopology] ->
> suspended -> [closeStateManager] ->
> dead
> And hence the assigned tasks contains the following non-overlapping sets : created, restoring, running, suspended, (dead tasks do no need to be maintained). Normally `created` should be empty since once a task is created it should move on transit to either restoring or running immediately. So whenever we are suspending tasks, we should go through these sets and act accordingly:
> 1. `created` and `suspended`: just check these two sets are always empty.
> 2. `running`: transit to `suspended`.
> 3. `restoring`: transite to `suspended`. But the difference here is that we do not need to close topology since it was not created yet at all; we just need to remember the restored position, and keep the restorers on hold instead of clearing all of them.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)