Abdelhakim Bendjabeur
10/30/2024, 3:52 PMenable.auto.commit is set to false
β’ async.capacity is set to 10
β’ 2 TMs, parallelism is 6.
-> If we reset the offsets to latest and with low traffic, it seems to work fine.
What could be the reason behind Flink being unable to commit offsets to Kafka in this scenario?Abdelhakim Bendjabeur
10/30/2024, 4:56 PMTRL Tech
10/30/2024, 5:05 PMOffset commit on checkpoint is disabled ?
Try settings the property commit.offsets.on.checkpoint to true (Although that should be the default)Abdelhakim Bendjabeur
10/30/2024, 5:18 PMNo checkpoint found during restore.
It did process records as we have seen them in the sink.
But when we reset the offsets to latest where there isn't a lot of traffic, it managed to commit the offsetsAbdelhakim Bendjabeur
10/30/2024, 5:18 PMTRL Tech
10/30/2024, 5:24 PMTRL Tech
10/30/2024, 5:30 PMearliest ? If it completes a checkpoint, the offset should be committed π€·ββοΈAbdelhakim Bendjabeur
10/31/2024, 9:27 AMIf it completes a checkpoint, the offset should be committed π€·ββοΈThat's the weird part. We reset the offsets to
earliest , and started the app.
It processed records (we have seen them in the sink topic and in DB.Abdelhakim Bendjabeur
10/31/2024, 9:29 AMConsumer group 'flink-ticket-auto-qa' has no active members.
GROUP TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG
flink-ticket-auto-qa auto-qa.commands.score-ticket 1 0 11015 11015
flink-ticket-auto-qa auto-qa.commands.score-ticket 0 0 10885 10885
flink-ticket-auto-qa auto-qa.commands.score-ticket 3 0 10973 10973
flink-ticket-auto-qa auto-qa.commands.score-ticket 2 0 10891 10891Abdelhakim Bendjabeur
10/31/2024, 9:30 AMAbdelhakim Bendjabeur
10/31/2024, 9:30 AMAbdelhakim Bendjabeur
10/31/2024, 9:31 AMTRL Tech
10/31/2024, 11:33 AM.setStartingOffsets(OffsetsInitializer.committedOffsets()) it will use the offset committed to kafka if it cannot find the offset in the latest checkpoint.Abdelhakim Bendjabeur
10/31/2024, 2:23 PMearliest as a
OffsetResetStrategy offsetResetStrategy = parameterTool.get("kafka.offsetResetStrategy", "earliest").equalsIgnoreCase("latest")
? OffsetResetStrategy.LATEST
: OffsetResetStrategy.EARLIEST;
KafkaDeserializationSchema<T> kafkaDeserializationSchema = ...;
KafkaSourceBuilder<T> eventKafkaSourceBuilder =
KafkaSource.<T>builder()
.setBootstrapServers(bootstrapServers)
.setTopics(Arrays.asList(topicName.split(",")))
.setGroupId(consumerGroup)
.setStartingOffsets(OffsetsInitializer.committedOffsets(offsetResetStrategy)) // <---- Here is where it get the strategy
.setDeserializer(KafkaRecordDeserializationSchema.of(kafkaDeserializationSchema));
checkpints folder in GCS only contained the _metadata file, and I am assuming that it is the case for stateless appsTRL Tech
11/01/2024, 12:25 PM