apache kafka - why delete the checkpoint file after finish loading its stored offsets? -




in kafka 0.10.2.0,when finished init processorstatemanager,why delete checkpoint file:

// load checkpoint information offsetcheckpoint checkpoint = new offsetcheckpoint(new file(this.basedir, checkpoint_file_name)); this.checkpointedoffsets = new hashmap<>(checkpoint.read());  // delete checkpoint file after finish loading stored offsets checkpoint.delete(); 

if kill application forcefully, , restart it, not load checkpoint file because deleted, when restoring partition's state:

if (checkpointedoffsets.containskey(storepartition)) {     restoreconsumer.seek(storepartition, checkpointedoffsets.get(storepartition)); } else {     restoreconsumer.seektobeginning(singleton(storepartition)); } 

as execute seektobeginning, consumer consume offset 0.

i find answer:

kafka-4317

patch





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -