This is an automated email from the ASF dual-hosted git repository.

fanrui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 17581beed0c684550e554136531b77f2f22db164
Author: Rui Fan <[email protected]>
AuthorDate: Mon Mar 2 11:50:00 2026 +0100

    [FLINK-39140][test] Fix MAX_RETAINED_CHECKPOINTS not effective in 
UnalignedCheckpointRescaleWithMixedExchangesITCase
    
    Move MAX_RETAINED_CHECKPOINTS from per-job config to MiniCluster cluster
    config. StandaloneCompletedCheckpointStore reads this value from the
    cluster-level configuration, so setting it in StreamExecutionEnvironment
    had no effect (defaulting to 1). This caused checkpoint subsumption to
    delete the selected checkpoint before the next job could restore from it.
---
 .../UnalignedCheckpointRescaleWithMixedExchangesITCase.java    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/flink-tests/src/test/java/org/apache/flink/test/checkpointing/UnalignedCheckpointRescaleWithMixedExchangesITCase.java
 
b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/UnalignedCheckpointRescaleWithMixedExchangesITCase.java
index fe6b065ce66..e216f8cbbbf 100644
--- 
a/flink-tests/src/test/java/org/apache/flink/test/checkpointing/UnalignedCheckpointRescaleWithMixedExchangesITCase.java
+++ 
b/flink-tests/src/test/java/org/apache/flink/test/checkpointing/UnalignedCheckpointRescaleWithMixedExchangesITCase.java
@@ -95,10 +95,16 @@ public class 
UnalignedCheckpointRescaleWithMixedExchangesITCase extends TestLogg
 
     @Before
     public void setup() throws Exception {
+        // MAX_RETAINED_CHECKPOINTS must be set at cluster level because
+        // StandaloneCompletedCheckpointStore reads it from the cluster config,
+        // not the per-job config. This prevents the picked checkpoint from 
being
+        // subsumed and deleted before the next job restores from it.
+        Configuration clusterConfig = new Configuration();
+        clusterConfig.set(CheckpointingOptions.MAX_RETAINED_CHECKPOINTS, 50);
         cluster =
                 new MiniClusterWithClientResource(
                         new MiniClusterResourceConfiguration.Builder()
-                                .setConfiguration(new Configuration())
+                                .setConfiguration(clusterConfig)
                                 .setNumberTaskManagers(NUM_TASK_MANAGERS)
                                 
.setNumberSlotsPerTaskManager(SLOTS_PER_TASK_MANAGER)
                                 .build());
@@ -181,8 +187,6 @@ public class 
UnalignedCheckpointRescaleWithMixedExchangesITCase extends TestLogg
         // The smaller the buffer size means the fewer records are needed to 
be consumed during
         // aligned checkpoint.
         conf.set(TaskManagerOptions.MEMORY_SEGMENT_SIZE, MemorySize.parse("1 
kb"));
-        // To prevent the picked checkpoint is deleted
-        conf.set(CheckpointingOptions.MAX_RETAINED_CHECKPOINTS, 50);
         if (recoveryPath != null) {
             conf.set(StateRecoveryOptions.SAVEPOINT_PATH, recoveryPath);
         }

Reply via email to