Github user kl0u commented on a diff in the pull request: https://github.com/apache/flink/pull/5691#discussion_r174150658 --- Diff: flink-queryable-state/flink-queryable-state-runtime/src/main/java/org/apache/flink/queryablestate/server/KvStateServerHandler.java --- @@ -78,13 +75,22 @@ public KvStateServerHandler( final CompletableFuture<KvStateResponse> responseFuture = new CompletableFuture<>(); try { - final InternalKvState<?> kvState = registry.getKvState(request.getKvStateId()); + final KvStateEntry<?, ?, ?> kvState = registry.getKvState(request.getKvStateId()); if (kvState == null) { responseFuture.completeExceptionally(new UnknownKvStateIdException(getServerName(), request.getKvStateId())); } else { byte[] serializedKeyAndNamespace = request.getSerializedKeyAndNamespace(); - byte[] serializedResult = kvState.getSerializedValue(serializedKeyAndNamespace); + // here we remove any type check... + // Ideally we want to keep that the info match the state. + final InternalKvState state = kvState.getState(); + final KvStateInfo info = kvState.getInfoForCurrentThread(); + + byte[] serializedResult = state.getSerializedValue( --- End diff -- True, but after also discussion with Stephan and Aljoscha we concluded that probably it is not the right place, just from a "separation-of-concerns" point of view. That said, the more I was working on it, the more I was thinking that the `InternalKvStates` could also be a place. But this we can leave for future discussion when we re-prioritize QS.
---