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

    https://github.com/apache/flink/pull/4357#discussion_r128147490
  
    --- Diff: 
flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase.java
 ---
    @@ -517,16 +519,13 @@ public void 
initializeState(FunctionInitializationContext context) throws Except
                                        LOG.debug("Using the following offsets: 
{}", restoredState);
                                }
                        }
    -                   if (restoredState != null && restoredState.isEmpty()) {
    -                           restoredState = null;
    -                   }
                } else {
                        LOG.info("No restore state for FlinkKafkaConsumer.");
                }
        }
     
        @Override
    -   public void snapshotState(FunctionSnapshotContext context) throws 
Exception {
    +   public final void snapshotState(FunctionSnapshotContext context) throws 
Exception {
    --- End diff --
    
    On the other hand, I think that this part of your description is strange:
    >we can't set Flink checkpoint to false, because otherwise Kafka consumer 
auto.commit will be hard-coded to true.
    This should not be the case (at least starting from Flink 1.3.x). The 
"auto.commit" is independent of checkpointing. If you don't enable 
checkpointing, "auto.commit" decides whether or not periodic checkpointing is 
used. Otherwise, you can still disable offset committing with checkpointing on 
by using `FlinkKafkaConsumer#disableOffsetCommittingOnCheckpoints`.


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