Hi. I am working with Flink DataStream API. We hav...
# troubleshooting
g
Hi. I am working with Flink DataStream API. We have a custom window with custom Window state. To not write custom serizalization code we just reused Flink POJO serializer like that:
Copy code
@Override
public TypeSerializer<SessionTimeWindow> getWindowSerializer(ExecutionConfig executionConfig) {
    return Types.POJO(SessionTimeWindow.class).createSerializer(new ExecutionConfig());
}
Unfortunately there is an issue with schema evolution of this state.
Copy code
org.apache.flink.util.StateMigrationException: The new namespace serializer (org.apache.flink.api.java.typeutils.runtime.PojoSerializer@e18e3041) must be compatible with the old namespace serializer (org.apache.flink.api.java.typeutils.runtime.PojoSerializer@97bf27ff).
after debugging that I found out that in
org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend#updateRestoredStateMetaInfo
Copy code
TypeSerializerSchemaCompatibility<N> s =
                restoredKvStateMetaInfo.updateNamespaceSerializer(namespaceSerializer);
        if (s.isCompatibleAfterMigration() || s.isIncompatible()) {
            throw new StateMigrationException(
the
updateNamespaceSerializer
does return
Type.COMPATIBLE_AFTER_MIGRATION
which is like I would expect but then why it is written in a way that compatible migratable state still throws a
StateMigrationException
? What am I missing?