[SUPPORT]: Hudi Deltastreamer OffsetoutofRange Exception reading from Kafka topic (12 partitions)
-
Have you gone through our FAQs? Yes
-
Join the mailing list to engage in conversations and get faster support at [email protected].
-
If you have triaged this as a bug, then file an issue directly.
Describe the problem you faced org.apache.kafka.clients.consumer.OffsetOutOfRangeException: Offsets out of range with no configured reset policy for partitions: {enriched-output-changelog-0=0}
A clear and concise description of the problem. Running Deltastreamer to consume from partitioned(12) compacted topic and persisting the data in MapR Platform , while consuming we are getting this exception of Offset being out of range and our Pod is being terminated . we did try running in continuous mode with MOR storage type initially , did face the offset exception and we could able to achieve it running by cleaning up the Kafka topic and restarted our pod . Our requirement slightly changed so we don't need to run it continuous , so scheduling mini batch (every 2 hours) so facing same offset exception now. Downstream consumers doesn't require to consume real time so switched to COPY_ON_WRITE and non continuous mode with checkpoint in place to run in mini batch.
To Reproduce
Steps to reproduce the behavior:
1. 2. 3. 4.
Expected behavior the Files need to be cut equally more likely default size(128MB) and persist into our HDFS location.
Environment Description
-
Hudi version : 0.5.2
-
Spark version : 2.2.1
-
Hive version :
-
Hadoop version : maps 6.01 and Hadoop 2.7
-
Storage (HDFS/S3/GCS..) : HDFS
-
Running on Docker? (yes/no) : yes
Additional context
Add any other context about the problem here.
Stacktrace
Add the stacktrace of the error.
@prashanthpdesai quick questions.
Where do you checkpoint the offsets between mini batches? and how do you configure that to deltastreamer?
Do you have the offset that you used to run this batch ()which failed with out of range) ?
If yes can you check if that msg offset is indeed present in the kafka topic (to avoid the possibility of your kafka retention policy deleting those msgs) . You can get smallest offset available for a topic partition by running this kafka command line
bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list <broker-ip:9092> --topic <topic-name> --time -2
@bhasudha : I presume that offset for each partitions will be stored the commit metadata in HDFS path, since its first run we used auto.offset.reset earliest to consume it from beginning . for incremental run offset will be picked up automatically rite from the HDFS path ? please correct me if my understanding is wrong. Command we used to run in kubenetes pod:
spark-submit "--props", System.getenv("KAFKA_PROP_FILE"), "--schemaprovider-class", "org.apache.hudi.utilities.schema.SchemaRegistryProvider", "--source-class","org.apache.hudi.utilities.sources.AvroKafkaSource", "--target-base-path",System.getenv("HUDI_OUTPUT_LOC"), "--target-table", "mcm.hudi.deltacow", "--table-type", "COPY_ON_WRITE", "--checkpoint", "--commit-on-errors", "--op", "UPSERT", "--source-ordering-field", "modifiedDt".
For first run , #kafka prop file hoodie.deltastreamer.source.kafka.topic=enriched-output-changelog hoodie.auto.commit=false enable.auto.commit=false auto.offset.reset=earliest
we did try to both earliest and latest as well but we ended up with same exception.
@prashanthpdesai sorry I assumed you were referring to your own check pointing. Your understanding is right. Checkpoints are written to hoodie commit metadata after each round of DeltaStreamer run.
The Exception you described seems to be possible if the offfsets supplied is larger or smaller than what the server has for a given partition. I am suspecting if this could be be because of retention policy of the kafka topic kicking in. It should be easy to check this. I think some command like this kafka-topics.sh --bootstrap-server server_ip:9092 --describe --topic topic_name will help print the topic config. Can we start to debug from there?
@bhasudha: The offset issue actually occurred due our internal topic clean up, and last written checkpoint was not able to find the offset value in topic . the issue has been resolved and job is running fine .
Sounds good. Thanks for updating. Feel free to re-open anytime if this becomes relevant.