MarkOffset
doesn't persist offset
#23
Comments
Hey @curtisallen, so no, I haven't checked zookeeper since kafka 0.9, but sarama-cluster's tests seem to pass which suggests that offsets are committed somewhere. To my knowledge kafka 0.9 is using a special internal topic for offset management (see here) instead of zookeeper, there is also a section for migrating offsets in the latest documentation. |
Thanks for the quick reply @dim I was looking into the tests and love the kafka broker spawn approch you've done. I could be misreading the tests but it looks as if the actual offset verification happens via a mock client and doesn't actually query Kafka (here) Finally I'd expect the vagrant@vagrant-ubuntu-trusty-64:/opt/kafka-9091/bin$ !186
./kafka-consumer-groups.sh --new-consumer --bootstrap-server 192.168.100.67:9091 --list
bsm
vagrant@vagrant-ubuntu-trusty-64:/opt/kafka-9091/bin$ !194
./kafka-consumer-groups.sh --new-consumer --bootstrap-server 192.168.100.67:9091 --describe --group bsm
Error while executing consumer group command Error reading field 'user_data': java.lang.IllegalArgumentException
org.apache.kafka.common.protocol.types.SchemaException: Error reading field 'user_data': java.lang.IllegalArgumentException
at org.apache.kafka.common.protocol.types.Schema.read(Schema.java:71)
at org.apache.kafka.clients.consumer.internals.ConsumerProtocol.deserializeAssignment(ConsumerProtocol.java:109) |
So yeah, https://github.com/bsm/sarama-cluster/blob/master/cmd/sarama-cluster-cli/main.go never actually calls |
Ignore me, it actually does. Will investigate. |
OK, so I have done this and it works absolutely fine:
As you can see, the consumer resumes from the last consumed offsets. Anything I am missing here? |
Thanks for looking into this. I've seen the behavior you described above, the offset seems to be persisted. However if you wait a couple of hours and relaunch your consumer or restart the kafka broker the consumer will start at the oldest offset again. |
What ever the issue I think you've proven that this problem is apart of Sarama or this package. The offsets are persisted but then get lost in kafka somehow, most likely a kafka bug. I'll keep digging there. |
For prosperities sake... You can read the resolution here |
One more thing to note.
|
Could either of these be related: |
Oh wow interesting that does sound similar. I'll have to retest with the
|
First thank you for writing this library it's been a great help to us.
I'm noticing some strange behavior with offset persistence. I've been testing with the provided
cmd/sarama-cluster-cli/main.go
tool, targeting a kafka broker set up using sarama's vagrant environment.Consumer metadata doesn't seem to be making it to zookeeper
/consumer
path. This prevents Kafka's tools likekafka-consumer-groups.sh
from working properly, furthermore after a broker restart or consumer restart the offset position is lost resulting it data processing loss. I'm not sure if this is a bug in this project or in sarama but thought this would be a good place to start.Here is a session where I use kafka's
verifiable-producer
tool to publish 10 messages on a topichttps://asciinema.org/a/1ohv1sp2h19wz9vkt4w2qcmt2
Then I start a sarama-cluster using
Keeping this consumer running I inspect zookeeper and no consumer data is found.
https://asciinema.org/a/1n3dwextiqnl4kfma2lbselmp
It's my understanding that kafka should be handling all of the zookeeper ugliness for us, but that doesn't seem to be the case. Looking into the kafka zookeeper utility I noticed that the
/consumers
path is still used on the kafka side.Have you ever seen your offsets persist in zookeeper using sarama-cluster?
The text was updated successfully, but these errors were encountered: