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

Hangxiang Yu commented on FLINK-23143:
--------------------------------------

Hi, [~roman].
IIUC, we need to create and maintain a new state in 
_ChangelogKeyedStateBackend_ in your solution ?
It may not work well in the case of switching changelog from enabled to 
disabled ?

Another solution is to make changelog part use correct 
_RegisteredKeyValueStateBackendMetaInfo/RegisteredPriorityQueueStateBackendMetaInfo_
 when recovery.

(We create 
_RegisteredKeyValueStateBackendMetaInfo/RegisteredPriorityQueueStateBackendMetaInfo_
 with _StateMetaInfoSnapshot_ in

_ChangelogBackendLogApplier#restoreKvMetaData_ and 
_ChangelogBackendLogApplier#restorePqMetaData_ but not use them)

But two new methods may be introduced in 
{_}KeyedStateBackend{_}.e.g.{_}create(RegisteredPriorityQueueStateBackendMetaInfo
 metaInfo).{_}

I have tried to do a simple POC and it works. But it may not be a good idea to 
introduce some new methods in _KeyedStateBackend._
WDYT?

> Support state migration
> -----------------------
>
>                 Key: FLINK-23143
>                 URL: https://issues.apache.org/jira/browse/FLINK-23143
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Runtime / State Backends
>            Reporter: Roman Khachatryan
>            Priority: Minor
>             Fix For: 1.16.0
>
>
> ChangelogKeyedStateBackend.getOrCreateKeyedState is currently used during 
> recovery; on 1st user access, it doesn't update metadata nor migrate state 
> (as opposed to other backends).
>  
> The proposed solution is to
>  # wrap serializers (and maybe other objects) in getOrCreateKeyedState
>  # store wrapping objects in a new map keyed by state name
>  # pass wrapped objects to delegatedBackend.createInternalState
>  # on 1st user access, lookup wrapper and upgrade its wrapped serializer
> This should be done for both KV/PQ states.
>  
> See also [https://github.com/apache/flink/pull/15420#discussion_r656934791]
>  
> cc: [~yunta]



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to