From 42bb88757bc25c27d5c1d8b44c9865f8ced3790c Mon Sep 17 00:00:00 2001 From: Weiqing Yang Date: Fri, 15 May 2026 17:50:56 -0700 Subject: [PATCH] [hotfix] Remove unused DurableExecutionManager.maybePruneState helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `DurableExecutionManager.maybePruneState(Object, long)` has no production callers and is not part of the `ActionStatePersister` interface — only a single test method references it. It is a leftover from the #546 refactor. Timeline (from `git log -S "maybePruneState"`): - #138 introduced `maybePruneState(...)` as a `private` helper on `ActionExecutionOperator`, called from the per-key completion path: `maybePruneState(key, sequenceNumber);`. - #603 ("Fix prune state corner cases around checkpoints") deliberately removed both the call site and the helper. The fix moved pruning from the per-key path to the checkpoint-driven path inside `notifyCheckpointComplete`, where it now prunes using `lastCompletedSequenceNumber` captured at the checkpoint barrier via `snapshotLastCompletedSequenceNumbers`. That is the current/correct architecture. - #546 ("Refactor ActionExecutionOperator into focused manager classes") extracted `DurableExecutionManager` and re-surfaced `maybePruneState(...)` on the new class — but no caller was re-added, correctly so. This commit removes the orphan. Changes: - Delete `DurableExecutionManager.maybePruneState(Object, long)`. - Drop the `dem.maybePruneState("k", 0L);` line from the existing `noStoreModeMakesAllMaybeOperationsNoOp` no-op coverage test. The remaining `maybe*` no-op assertions still cover the null-store invariant for every `maybe*` method on the class today. --- .../agents/runtime/operator/DurableExecutionManager.java | 6 ------ .../runtime/operator/DurableExecutionManagerTest.java | 1 - 2 files changed, 7 deletions(-) diff --git a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/DurableExecutionManager.java b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/DurableExecutionManager.java index 85c5df23a..d2b324e9a 100644 --- a/runtime/src/main/java/org/apache/flink/agents/runtime/operator/DurableExecutionManager.java +++ b/runtime/src/main/java/org/apache/flink/agents/runtime/operator/DurableExecutionManager.java @@ -319,12 +319,6 @@ public void persist( } } - void maybePruneState(Object key, long sequenceNum) throws Exception { - if (actionStateStore != null) { - actionStateStore.pruneState(key, sequenceNum); - } - } - /** * Prunes durable state for all per-key sequence numbers that were captured at the time of the * given checkpoint. diff --git a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/DurableExecutionManagerTest.java b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/DurableExecutionManagerTest.java index f5fc2a172..de8a653cf 100644 --- a/runtime/src/test/java/org/apache/flink/agents/runtime/operator/DurableExecutionManagerTest.java +++ b/runtime/src/test/java/org/apache/flink/agents/runtime/operator/DurableExecutionManagerTest.java @@ -64,7 +64,6 @@ void noStoreModeMakesAllMaybeOperationsNoOp() throws Exception { // Every maybe* method must be a silent no-op. assertThat(dem.maybeGetActionState("k", 0L, action, event)).isNull(); dem.maybeInitActionState("k", 0L, action, event); - dem.maybePruneState("k", 0L); dem.notifyCheckpointComplete(1L); dem.snapshotRecoveryMarker(); dem.close();