featzhang commented on code in PR #27954:
URL: https://github.com/apache/flink/pull/27954#discussion_r3100551590
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/utils/FailingCollectionSource.java:
##########
@@ -166,9 +166,13 @@ public void run(SourceContext<T> ctx) throws Exception {
if (!failedBefore) {
// delay a bit, if we have not failed before
Thread.sleep(1);
- if (numSuccessfulCheckpoints >= 1 &&
lastCheckpointedEmittedNum >= 1) {
- // cause a failure if we have not failed before and have a
completed checkpoint
- // and have processed at least one element
+ if (numSuccessfulCheckpoints >= 1
Review Comment:
Good catch, thanks! You are right — since `lastCheckpointedEmittedNum` is
only updated inside `notifyCheckpointComplete()`, the condition
`lastCheckpointedEmittedNum >= failureAfterNumElements` already implies that at
least one checkpoint has completed successfully. The `numSuccessfulCheckpoints
>= 1` check is therefore redundant.
I have removed the `numSuccessfulCheckpoints` field entirely and simplified
the condition accordingly. Updated in the latest commit.
--
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]