You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/07/29 06:05:21 UTC

[GitHub] [flink] masteryhx commented on a diff in pull request #20313: [FLINK-28597][state] Discard initial checkpoints without a delay in common cases

masteryhx commented on code in PR #20313:
URL: https://github.com/apache/flink/pull/20313#discussion_r932892479


##########
flink-runtime/src/test/java/org/apache/flink/runtime/state/SharedStateRegistryTest.java:
##########
@@ -182,20 +194,113 @@ public void testRegisterChangelogStateBackendHandles() throws InterruptedExcepti
     }
 
     @Test
-    public void testUnregisterUnusedState() {
+    public void testUnregisterUnusedSavepointState() {
         SharedStateRegistry sharedStateRegistry = new SharedStateRegistryImpl();
         TestingStreamStateHandle handle = new TestingStreamStateHandle();
-        sharedStateRegistry.registerReference(new SharedStateRegistryKey("first"), handle, 1L);
-        sharedStateRegistry.registerReference(new SharedStateRegistryKey("first"), handle, 2L);
-        sharedStateRegistry.registerReference(new SharedStateRegistryKey("first"), handle, 3L);
+
+        registerInitialCheckpoint(
+                sharedStateRegistry,
+                RESTORED_STATE_ID,
+                CheckpointProperties.forSavepoint(false, SavepointFormatType.NATIVE));
+
+        sharedStateRegistry.registerReference(

Review Comment:
   I am a bit confused about the test.
   The default setting of restore mode in this test is NO_CLAIM mode.
   So the mock and the deletion shouldn't occur in the default mode?
   BTW, I think we may need to test CLAIM mode and NO_CLAIM mode both.
   WDYT?



-- 
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-unsubscribe@flink.apache.org

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