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

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

Maybe I missed something. So what do you mean about "store wrapping objects in 
a new map keyed by state name" ?

In the solution, If we don't add a new state, could we avoid updating 
_RegisteredKeyValueStateBackendMetaInfo_ which use an

_EagerlyRegisteredStateSerializerProvider_ that don't support to register a new 
serializaer?



I mean adds

_getOrCreateKeyedState(RegisteredKeyValueStateBackendMetaInfo<N, T> metaInfo, 
StateDescriptor<S, T> stateDesc)_

to _KeyedStateBackend_ so Chaneglog could use the method instead of 

_getOrCreateKeyedState(TypeSerializer<N> namespaceSerializer, 
StateDescriptor<S, T> stateDescriptor)_

when recovery because the pre method will register 
_RegisteredKeyValueStateBackendMetaInfo_ which use an 

_LazilyRegisteredStateSerializerProvider._

 

The proposal is simple and works but it adds a extra methods to 
_KeyedStateBackend_ and other state backend have to implement it. 

I think if your solution could solve the question I mentioned above, maybe it 
will be better.

> 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