Hi Team, I am seeing differences on how the state...
# troubleshooting
s
Hi Team, I am seeing differences on how the state is restored after a Flink Job crashes between the below two variations of Kafka Source configurations. Checkpointing frequency is every 10s. Config-1
Copy code
KafkaSourceFooBarData fooBarSource = KafkaSource.FooBarDatabuilder()
        	.setTopics("foobar")
            .setGroupId("foobar")
            .setStartingOffsets(
OffsetsInitializer.committedOffsets(OffsetResetStrategy.EARLIEST))
        	.setValueOnlyDeserializer(new JsonDeserializationSchemaFooBarData(FooBarData.class))
        	.build();
Config-2
Copy code
KafkaSourceFooBarData fooBarSource = KafkaSource.FooBarDatabuilder()
        	.setTopics("foobar")
            .setGroupId("foobar")
            .setStartingOffsets(OffsetsInitializer.latest())
        	.setValueOnlyDeserializer(new JsonDeserializationSchemaFooBarData(FooBarData.class))
        	.build();
This is how my Flink Job looks, where the
TimeCountTrigger
throws Exception when batch size is 20 (Its a self injected exception to test Job recovery). Approximate time taken to form a batch of 40 will be ~40secs.
Copy code
KafkaSource<> ... // as described above

SingleOutputStreamOperator<ListString> batchedStream = fooBarStream
            .windowAll(GlobalWindows.create())
            .trigger(new TimeCountTrigger<>(40L /*batchSize*/, 60*1000L /*batchInterval*/))
            .process(new BatchWindowFn());
So, in Config-1 I am observing that the checkpointing in Windowing operator is always failing even if I have configured to checkpoint at every 10secs. In Config-2 I am observing that the checkpointing is happening successfully every 10secs and state is restored on Job restart. Can someone please explain this behaviour, as the only difference in Config-1 and Config-2 is how the offset is initialized in the Kafka Source? Any directions on how to understand this will be highly appreciated.
✅ 1
This is resolved.