fapaul commented on code in PR #25368:
URL: https://github.com/apache/flink/pull/25368#discussion_r1770987987


##########
flink-tests/src/test/java/org/apache/flink/test/streaming/runtime/UnifiedSinkMigrationITCase.java:
##########
@@ -265,16 +266,24 @@ private static class TestCommitter implements 
Committer<Integer> {
             this.commitLatch = commitLatch;
         }
 
+        /**
+         * On first attempt: send GLOBAL_COMMITTER_STATE downstream, keep 
COMMITTER_STATE for retry.
+         * On second attempt: keep COMMITTER_STATE for retry on first 
checkpoint, then send
+         * downstream. Only then, global committer should be triggered.
+         */
         @Override
         public List<Integer> commit(List<Integer> committables)
                 throws IOException, InterruptedException {
             if (firstCommit && !recovered) {
                 assertThat(committables).containsExactly(COMMITTER_STATE, 
GLOBAL_COMMITTER_STATE);
-            } else {
+            } else if (recovered && firstCommit) {
                 assertThat(committables).containsExactly(COMMITTER_STATE);
             }

Review Comment:
   Nit: Might be a bit easier to read and avoid the `else-if` statement.
   ```java
   if (firstCommit) {
     if (recovered) {
        assertThat(committables).containsExactly(COMMITTER_STATE);
     } else {
       assertThat(committables).containsExactly(COMMITTER_STATE, 
GLOBAL_COMMITTER_STATE);
     }
   }
   ```



-- 
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]

Reply via email to