fredia commented on code in PR #19448:
URL: https://github.com/apache/flink/pull/19448#discussion_r882360519
##########
flink-runtime/src/main/java/org/apache/flink/runtime/state/SharedStateRegistryImpl.java:
##########
@@ -156,16 +165,40 @@ public void unregisterUnusedState(long
lowestCheckpointID) {
subsumed.add(entry.stateHandle);
}
it.remove();
+ } else {
+
markCheckpointInUseAction.accept(entry.createdByCheckpointID);
}
}
}
-
LOG.trace("Discard {} state asynchronously", subsumed.size());
for (StreamStateHandle handle : subsumed) {
scheduleAsyncDelete(handle);
}
}
+ @Override
+ public void unregisterUnusedState(long lowestCheckpointID) {
+ // only used for some tests
+ unregisterState(lowestCheckpointID, (x) -> {});
+ }
+
+ @Override
+ public void unregisterUnusedStateAndCheckpoint(
+ long lowestCheckpointID,
+ CheckpointsCleaner checkpointsCleaner,
+ Runnable postCleanUp,
+ @Nullable Executor executor) {
+ Set<Long> checkpointInUse = new HashSet<>();
+ unregisterState(lowestCheckpointID, id -> checkpointInUse.add(id));
+ if (executor != null) {
+ checkpointsCleaner.cleanSubsumedCheckpoints(
+ lowestCheckpointID, checkpointInUse, postCleanUp,
executor);
+ } else {
+ checkpointsCleaner.cleanSubsumedCheckpoints(
+ lowestCheckpointID, checkpointInUse, postCleanUp,
asyncDisposalExecutor);
Review Comment:
That makes sense to me, fixed
--
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]