davidradl commented on code in PR #26416:
URL: https://github.com/apache/flink/pull/26416#discussion_r2032826706


##########
flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/ForStKeyedStateBackend.java:
##########
@@ -445,6 +445,22 @@ private <N, UK, SV> 
RegisteredKeyValueStateBackendMetaInfo<N, SV> updateRestored
 
         RegisteredKeyValueStateBackendMetaInfo<N, SV> restoredKvStateMetaInfo 
= oldStateInfo.f1;
 
+        // fetch current namespace serializer now because if it is 
incompatible, we can't access
+        // it anymore to improve the error message
+        TypeSerializer<N> previousNamespaceSerializer =
+                restoredKvStateMetaInfo.getNamespaceSerializer();
+
+        TypeSerializerSchemaCompatibility<N> s =
+                
restoredKvStateMetaInfo.updateNamespaceSerializer(namespaceSerializer);
+        if (s.isCompatibleAfterMigration() || s.isIncompatible()) {

Review Comment:
   I am curious about the difference between` isCompatibleAfterMigration()` and 
`isIncompatible()`. If the difference is meaningful, should we include these 
different incompatibilities in the error message to help make the message more 
useful?
   
   It would even better if the compatibility checks returned the reason for the 
incompatibility. Maybe throwing an exception in a checkIncompatibility method 
and construct different messages in the Exception might be better as we then 
log out the root cause of the incompatibility. WDYT?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to