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



##########
File path: 
flink-state-backends/flink-statebackend-changelog/src/main/java/org/apache/flink/state/changelog/ChangelogKeyedStateBackend.java
##########
@@ -600,8 +600,14 @@ private ChangelogSnapshotState completeRestore(
                                     System.currentTimeMillis(),
                                     streamFactory,
                                     CHECKPOINT_OPTIONS),
-                            // TODO: add metadata to log FLINK-23170.
-                            upTo));
+                            upTo);
+
+            // log metadata after materialization is triggered
+            keyValueStatesByName
+                    .values()
+                    .forEach(t -> ((AbstractChangelogState) 
t).resetMetaDataWritten());

Review comment:
       Sure, sorry, I mean the whole function is executed by the main task 
thread and this is blocking normal processing.
   And `forEach` can be slower than a simple `for` loop, so it makes sense to 
shorten this time.




-- 
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