I,m trying to test Flink 1.8.0 exactly-once semantics with Kafka Source and Sink:
I expect to see monotonically increasing integers in output topic regardless TaskManager killing and recovery. But actually a see something unexpected in console-consumer output:
Looks like all messages between checkpoints where replayed in output topic. Also i expected to see results in output topic only after checkpointing i.e. each 20 seconds, but messages appeared in output immediately as they where send to input. Kafka version 1.0.1 from Cloudera parcels. I tested Kafka transactional producer and read-committed console comsumer with custom code and it worked perfectly well reading messages only after commitTransaction on producer. My Flink code:
|
Hi Vasily,
You're probably executing this from your IDE or from a local Flink cluster without starting your job from a checkpoint. When you start your Flink job for the second time you need to specify the path to the latest checkpoint as an argument, otherwise Flink will start from scratch. You're probably thinking that's not great, ideally Flink should be able to automatically continue from the last produced checkpoint, and actually that's what the docs say! Well, that's only when you're running in a proper cluster environment. Flink is able to recover using checkpoints when only part of the cluster fails, not when the whole job is stopped. For full stops you need to specify the checkpoint manually. Hope that helps! On Fri, 2 Aug 2019, 10:05 Vasily Melnik, <[hidden email]> wrote:
|
Hi, Eduardo. Maybe i should describe experiment design precisely : 1) I run Flink on YARN (YARN Session method). 2) I do not stop/cancell application, i just kill TaskManager process 3) After that YARN creates another TaskManager Process and auto checkpoint restore from HDFS happens. That's why i expect to see correct restore. On Fri, 2 Aug 2019 at 13:04, Eduardo Winpenny Tejedor <[hidden email]> wrote:
|
Hi Vasily, as far as I know, by default console-consumer reads uncommited. Try setting
isolation.level to read_committed in console-consumer properties. Hope this helps, Maxim. On Fri, Aug 2, 2019 at 12:42 PM Vasily Melnik <[hidden email]> wrote:
|
Hi, Maxim. My console-consumer command: kafka-console-consumer --zookeeper ... --topic test --from-beginning --isolation-level read_committed It works perfectly well with manually written kafka producer - it reads data only after commitTransaction. On Fri, 2 Aug 2019 at 14:19, Maxim Parkachov <[hidden email]> wrote:
|
In reply to this post by Vasily Melnik
Hi Vasily, I haven't tested the stare recovery under YARN setup. But in case of stand-alone Flink cluster setup, I needed to run the application with proper open-checkpoint recovery directory (whose name stars with 'chk-') passed as -s parameter value. This was the only way I could recover my application state from an ungraceful shutdown. Hope that it helps, and would be glad if some one could suggest a better solution. BR, MoeOn 02/08/2019 12:41, Vasily Melnik wrote:
--
Mohammad Hosseinian |
Free forum by Nabble | Edit this page |