[ https://issues.apache.org/jira/browse/KAFKA-10575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17553806#comment-17553806 ]
Guozhang Wang commented on KAFKA-10575: --------------------------------------- I took another look at this ticket while working on KAFKA-10199 in parallel, and here are some updates: 1. I could confirm that today we only call `onRestoreEnd` for case 1 above, and for case 2/3 from [~ableegoldman] we do not (in fact case 3) is just a special case of case 2) since we would first transit to CLOSED anyways). 2. On a second thought, there may be different group of users who were anticipating the semantics of such callbacks, for example: a) The original complaint that drives this ticket, is based on the anticipation that each `onRestoreStart` would always be paired with an `onRestoreEnd`. This is not actually the case because of case 2/3 above. b) Others may anticipate that `onRestoreEnd` is only triggered when the restoration is actually completed. In fact this is what we explicitly stated in the javadocs. So, if we just call `onRestoreEnd` on case 2/3) above, we may make users in a) happier but we would break compatibilities of users in b). In addition, since given the same topic-partition, and store names, there might be multiple restoration process happening at the same time e.g. when there are standby replicas, it's not very straight-forward trying to pair each one of `onRestoreStart` with a unique `onRestoreEnd`. With those thoughts, I'm now leaning towards not just calling `onRestoreEnd` for case 2/3), but instead introduce a new API e.g. `onRestorePaused` for case 2/3), plus also document clearly that not every `onRestoreStart` would be paired exactly with an `onRestoreEnd/Paused` to reduce user's unrealistic anticipations. Thoughts? > 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.20.7#820007)