Myasuka commented on a change in pull request #18391:
URL: https://github.com/apache/flink/pull/18391#discussion_r787321825
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/state/SharedStateRegistryTest.java
##########
@@ -98,6 +106,77 @@ public void testUnregisterWithUnexistedKey() {
sharedStateRegistry.unregisterUnusedState(Long.MAX_VALUE);
}
+ @Test
+ public void testRegisterChangelogStateBackendHandles() throws
InterruptedException {
+ SharedStateRegistry sharedStateRegistry = new
SharedStateRegistryImpl();
+ long materializationId1 = 1L;
+ IncrementalStateHandleWrapper incrementalTMStateHandle1 =
+ createDummyIncrementalStateHandle(materializationId1);
+
+ IncrementalStateHandleWrapper incrementalJMStateHandle11 =
incrementalTMStateHandle1.copy();
+ ChangelogStateHandleWrapper changelogStateHandle1 =
createDummyChangelogStateHandle(1, 2);
+ long checkpointId1 = 41;
+ ChangelogStateBackendHandle.ChangelogStateBackendHandleImpl
changelogStateBackendHandle1 =
+ new
ChangelogStateBackendHandle.ChangelogStateBackendHandleImpl(
+ Collections.singletonList(incrementalJMStateHandle11),
+ Collections.singletonList(changelogStateHandle1),
+ incrementalTMStateHandle1.getKeyGroupRange());
+ changelogStateBackendHandle1.registerSharedStates(sharedStateRegistry,
checkpointId1);
+ sharedStateRegistry.checkpointCompleted(checkpointId1);
+ sharedStateRegistry.unregisterUnusedState(checkpointId1);
+
+ IncrementalStateHandleWrapper incrementalJMStateHandle12 =
incrementalTMStateHandle1.copy();
Review comment:
The `copy()` method is due to I still call
`stateRegistry.registerAll(materialized, checkpointID)` and the problem in
FLINK-25479 caused this.
As we still need to call the materialized CompositeStateHandle to register
themselves, I have to add the copy method.
--
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]