Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/997#discussion_r37883013
  
    --- Diff: 
flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/api/functions/source/FileSourceFunction.java
 ---
    @@ -120,12 +131,24 @@ public void run(SourceContext<OUT> ctx) throws 
Exception {
                        OUT nextElement = serializer.createInstance();
                        nextElement =  format.nextRecord(nextElement);
                        if (nextElement == null && splitIterator.hasNext()) {
    -                           format.open(splitIterator.next());
    +                           InputSplit split = splitIterator.next();
    +                           splitNumber = split.getSplitNumber();
    +                           currRecord = 0l;
    +                           format.open(split);
                                continue;
                        } else if (nextElement == null) {
                                break;
                        }
    -                   ctx.collect(nextElement);
    +                   if(splitNumber == checkpointedSplit){
    --- End diff --
    
    What if you've checkpointed the 2. split after seeing the 1. and 2. split 
and now the source is re-executed with the first split? Aren't records written 
again because you only save the latest checkpointed split number?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to