[
https://issues.apache.org/jira/browse/FLINK-6600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16015849#comment-16015849
]
ASF GitHub Bot commented on FLINK-6600:
---------------------------------------
Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/3925#discussion_r117266306
--- Diff:
flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackend.java
---
@@ -1116,13 +1116,27 @@ private void restoreKeyGroupsInStateHandle()
* @throws ClassNotFoundException
* @throws RocksDBException
*/
+ @SuppressWarnings("unchecked")
private void restoreKVStateMetaData() throws IOException,
ClassNotFoundException, RocksDBException {
KeyedBackendSerializationProxy serializationProxy =
new
KeyedBackendSerializationProxy(rocksDBKeyedStateBackend.userCodeClassLoader);
serializationProxy.read(currentStateHandleInView);
+ // check for key serializer compatibility; this also
reconfigures the
+ // key serializer to be compatible, if it is required
and is possible
+ if (StateMigrationUtil.resolveCompatibilityResult(
+ serializationProxy.getKeySerializer(),
+
TypeSerializerSerializationProxy.ClassNotFoundDummyTypeSerializer.class,
+
serializationProxy.getKeySerializerConfigSnapshot(),
+ (TypeSerializer)
rocksDBKeyedStateBackend.keySerializer)
+ .isRequiresMigration()) {
--- End diff --
Maybe as an idea for the future: If I'm not mistaken, then is the
KeySerializerConfigSnapshot constant across all `KeyedStateHandles`. Thus,
having something like a broadcast state for state backend meta data would be
cool. Then we don't have to store redundant information.
> Add key serializer's config snapshot to KeyedBackendSerializationProxy
> ----------------------------------------------------------------------
>
> Key: FLINK-6600
> URL: https://issues.apache.org/jira/browse/FLINK-6600
> Project: Flink
> Issue Type: Improvement
> Components: State Backends, Checkpointing
> Reporter: Tzu-Li (Gordon) Tai
> Assignee: Tzu-Li (Gordon) Tai
> Fix For: 1.3.0, 1.4.0
>
>
> Currently, only the key serializer is included in what's written for a keyed
> state backend in checkpoints. The namespace and state serializer already have
> their config snapshots included in the individual registered state's metainfo.
> We should also include the configuration snapshot of the key serializer in
> {{KeyedBackendSerializationProxy}} so that we can also be flexible in
> allowing migration / transformation of the key in the future.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)