Flink State 是有元数据的,元数据发生改变后,Flink 就无法从 ck 或者 savepoint 中恢复。
有时候明明没有改动关于 state 的任何东西,但突然报错了
Caused by: java.lang.Exception: error while restore processing keyedStatedBackend!
at org.apache.flink.streaming.api.operators.StreamTaskStateInitializerImpl.keyedStatedBackend(StreamTaskStateInitializerImpl.java:372)
at org.apache.flink.streaming.api.operators.StreamTaskStateInitializerImpl.streamOperatorStateContext(StreamTaskStateInitializerImpl.java:172)
error while restore processing keyedStatedBackend! 就很奇怪了。细细查看就发了改变的 keyby 对应的 value,然后就会觉得很奇怪,为啥改变它会无法从 ck 中恢复呢?
源码中已经枚举出来了,存在 Flink backends 中不同类型的 state,当他们中任何一个发生变化时都没有办法从 ck 中 restore