I am using kafka 2.10-0.9.0.1 When I delete a topic via command and topic is marked for deletion.
bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic T.AB_KAFF
However, as I publish messages to this topic and when I subscribe to this topic again, the topic description says that its lag is -ve of what was current offset (last committed offset)
bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server localhost:9092 --describe --group G.AB_KAFF
Last state of topic :
GROUP, TOPIC, PARTITION, CURRENT OFFSET, LOG END OFFSET, LAG, OWNER G.AB_KAFF, T.AB_KAFF, 0, 5, 5, 0, consumer-2_/127.0.0.1 G.AB_KAFF, T.AB_KAFF, 1, 5, 5, 0, consumer-2_/127.0.0.1
Now I delete the topic. And publish message to this topic
State of topic after subscribing again :
GROUP, TOPIC, PARTITION, CURRENT OFFSET, LOG END OFFSET, LAG, OWNER G.AB_KAFF, T.AB_KAFF, 0, 5, 1, -4, consumer-3_/127.0.0.1 G.AB_KAFF, T.AB_KAFF, 1, 5, 0, -5, consumer-3_/127.0.0.1
So why does kafka set the lag to -ve number. Isn't that is a potential to cause issues ?
Suppose I subscribe again to deleted topic, so I won't be getting any messages till its -ve lag is 0
Other Information :
- I am running 3 kafka nodes on my local
- I have added property : delete.topic.enable=true
- This topic is created with partitions=2, replication-factor=2
delete.topic.enable
in yourbroker
config file. ? – Kulasangar-ve lag
mean? So did your topic get deleted ? – Kulasangar