I have a Flink job with a sink that is writing the data into MongoDB. The sink is an implementation of RichSinkFunction
.
Externalized checkpointing enabled. The interval is 5000 mills and scheme is EXACTLY_ONCE.
- Flink version 1.3,
- Kafka (source topic) 0.9.0
I can't upgrade to the TwoPhaseCommitSink
of Flink 1.4.
I have few doubts
- At which point of time does the sink acknowledges the checkpoint barrier, at the start of the invoke function or when invoke completed? Means it waits for persisting (saving in MongoDB) response before acknowledging the barrier?
- If committing checkpoint is done by an asynchronous thread, how can Flink guarantee exactly once in case of job failure? What if data is saved by the sink to MongoDB but the checkpoint is not committed? I think this will end up duplicate data on restart.
- When I cancel a job from the Flink dashboard, will Flink complete the async checkpoint threads to complete or it's a hard kill -9 call?