[ https://issues.apache.org/jira/browse/KAFKA-10575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17308931#comment-17308931 ]
A. Sophie Blee-Goldman commented on KAFKA-10575: ------------------------------------------------ [~high.lee] this ticket is aimed at making sure the #onRestoreEnd callback is always invoked (if it exists) any time a task ends ongoing restoration. Specifically, we probably want to invoke it in all of these scenarios: # transition from RESTORING to RUNNING: ie, restoration has actually completed # transition from RESTORING to CLOSED: this one might be a bit tricky since technically a closing task must transition as RESTORING -> SUSPENDED -> CLOSED, but we do not want to invoke this callback if it's going to be resumed after suspension instead of closed. However a suspended task is only ever resumed when following EAGER rebalancing, which is likely not used in the latest versions and will be removed soon anyways, so maybe it's fine to just invoke it during the RESTORING -> SUSPENDED transition -- WDYT [~guozhang]? Also note, this transition will cover the case of a restoring task that hits TaskCorrupted and must be revived # RESTORING active task is recycled from active to standby As of today I believe we only trigger this callback in the 1st case, and possibly the 3rd. So this ticket would encompass confirming that we do this for recycled tasks and implementing it for closing tasks > StateRestoreListener#onRestoreEnd should always be triggered > ------------------------------------------------------------ > > Key: KAFKA-10575 > URL: https://issues.apache.org/jira/browse/KAFKA-10575 > Project: Kafka > Issue Type: Improvement > Components: streams > Reporter: Guozhang Wang > Assignee: highluck > Priority: Major > > Today we only trigger `StateRestoreListener#onRestoreEnd` when we complete > the restoration of an active task and transit it to the running state. > However the restoration can also be stopped when the restoring task gets > closed (because it gets migrated to another client, for example). We should > also trigger the callback indicating its progress when the restoration > stopped in any scenarios. -- This message was sent by Atlassian Jira (v8.3.4#803005)