rkhachatryan commented on code in PR #19907:
URL: https://github.com/apache/flink/pull/19907#discussion_r926118182
##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskLocalStateStoreImpl.java:
##########
@@ -141,6 +158,29 @@ public void storeLocalState(
subtaskIndex);
}
+ for (Map.Entry<OperatorID, OperatorSubtaskState> subtaskStateEntry :
+ localState.getSubtaskStateMappings()) {
+ for (KeyedStateHandle keyedStateHandle :
+ subtaskStateEntry.getValue().getManagedKeyedState()) {
+ if (keyedStateHandle instanceof ChangelogStateBackendHandle) {
+ ChangelogStateBackendHandle changelogStateBackendHandle =
+ (ChangelogStateBackendHandle) keyedStateHandle;
+ long materializationID =
changelogStateBackendHandle.getMaterializationID();
+ if (currentMaterializationID == null
Review Comment:
1. Yes, but this method is called after the actual recovery - when reporting
a new checkpoint
2. Yes, but relying on it seems fragile
How about adding an explicit check like this:
```
if (mapToMaterializationId.containsKey(checkpointId)) {
checkState(materializationID ==
mapToMaterializationId.get(checkpointId));
} else {
mapToMaterializationId.put(checkpointId,
materializationID);
}
```
and removing
```
if (mapToMaterializationId.getOrDefault(checkpointId, Long.MAX_VALUE)
< materializationID) {
LOG.info(
```
?
--
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]