[ 
https://issues.apache.org/jira/browse/KAFKA-10575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17605878#comment-17605878
 ] 

Nicholas Telford edited comment on KAFKA-10575 at 9/16/22 3:01 PM:
-------------------------------------------------------------------

Hi [~guozhang], I ran in to this issue today and have some thoughts on it.

I agree that {{onRestoreEnd}} currently implies that the restoration 
_completed_, since that's what the documentation says. I suggest we add a new 
method, {{StateRestoreListener#onRestoreAbort}} (or {{onRestoreSuspend}} or 
{{onRestorePaused}}, etc.), which handles the case that restoration was stopped 
before it could complete (i.e. because the {{Task}} was closed.)

It should be enough to simply call this new method in 
{{StoreChangelogReader#unregister}}, which is called when {{Task}}s are 
closed/migrated.

For backwards compatibility, this new method should have a {{default}} 
implementation in the {{StateRestoreListener}} interface that is a no-op.

What do you think? And since this involves adding a new method, do we need a 
KIP for this?


was (Author: nicktelford):
Hi [~guozhang], I ran in to this issue today and have some thoughts on it.

I agree that {{onRestoreEnd}} currently implies that the restoration 
_completed_, since that's what the documentation says. I suggest we add a new 
method, {{StateRestoreListener#onRestoreAbort}} (or {{onRestoreSuspend}} or 
{{onRestorePaused}}, etc.), which handles the case that restoration was stopped 
before it could complete (i.e. because the {{Task}} was closed.

It should be enough to simply call this new method in 
{{StoreChangelogReader#unregister}}, which is called when {{Task}}s are 
closed/migrated.

For backwards compatibility, this new method should have a {{default}} 
implementation in the {{StateRestoreListener}} interface that is a no-op.

What do you think? And since this involves adding a new method, do we need a 
KIP for this?

> 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.10#820010)

Reply via email to