rkhachatryan commented on a change in pull request #17203:
URL: https://github.com/apache/flink/pull/17203#discussion_r710125481



##########
File path: 
flink-state-backends/flink-statebackend-changelog/src/main/java/org/apache/flink/state/changelog/restore/ChangelogBackendRestoreOperation.java
##########
@@ -80,14 +89,19 @@
             ChangelogKeyedStateBackend<?> backend,
             ChangelogStateBackendHandle backendHandle,
             StateChangelogHandleReader<T> changelogHandleReader,
-            ClassLoader classLoader)
+            ClassLoader classLoader,
+            Map<UUID, Map<Short, StateID>> metadataByBackend)
             throws Exception {
         for (ChangelogStateHandle changelogHandle :
                 backendHandle.getNonMaterializedStateHandles()) {
+            Map<Short, StateID> stateIds =
+                    metadataByBackend.computeIfAbsent(
+                            backendHandle.getBackendID(), ign -> new 
HashMap<>());

Review comment:
       You are right, I've removed backend ID (both from handle and from 
backend itself).
   
   I started to 
[refactor](https://github.com/rkhachatryan/flink/tree/refactor-backend-test) 
rescaling tests to add more snapshots for the same backend and then shuffle 
them (so that metadata from one backend could overwrite metadata of another).
   
   But I realized that it won't break recovery, because each snapshot (i.e. 
`ChangelogStateBackendHandle`) contains metadata in the beginning; and reading 
of each such snapshot is "atomic" (i.e. doesn't interlieave with reading other 
snapshots).




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to