Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unacknowledged offsets can be commited #1

Open
tanguilp opened this issue Nov 14, 2019 · 1 comment
Open

Unacknowledged offsets can be commited #1

tanguilp opened this issue Nov 14, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@tanguilp
Copy link

tanguilp commented Nov 14, 2019

It seems that in https://github.com/sevenmind/kafka_ex_gen_stage_consumer/blob/master/lib/kafka_ex_gen_stage_consumer.ex#L398, offset is marked to be committed if it's higher than the last offset marked to be committed.

However, in situations when Kafka messages are processed in parallel, I think that such a case could occur:

  • Last acked offset is 100
  • Process A receives Kafka message with offset 101
  • Process B receives Kafka message with offset 102
  • Process B processes the message and sends an ack (calling KafkaExGenStageConsumer.trigger_commit/2)
  • kafka_ex_gen_stage_consumer commits the offset 102
  • Process B crashes

Message with offset 101 has not been processed, but committed offset is 102.

off_broadway_kafka uses an ETS table to keep track of acknowledged offsets: https://github.com/bbalser/off_broadway_kafka/blob/master/lib/off_broadway/kafka/acknowledger.ex

@gerbal gerbal added the bug Something isn't working label Nov 15, 2019
@gerbal
Copy link
Collaborator

gerbal commented Nov 15, 2019

This is certainly a potential issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants