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

Drop already buffered messages of revoked partitions #872

Closed
ennru opened this issue Aug 26, 2019 · 2 comments
Closed

Drop already buffered messages of revoked partitions #872

ennru opened this issue Aug 26, 2019 · 2 comments
Milestone

Comments

@ennru
Copy link
Member

ennru commented Aug 26, 2019

Short description

When a partition is revoked from an Alpakka Kafka consumer, it continues to emit data which was buffered before. This can be up to max.poll.records messages that got fetched just before the revoke was issued.

Instead, the stage should drop messages from its buffer when it doesn't have the partition assigned anymore.

Fixing this could reduce the number of re-delivered messages at rebalances significantly.

Details

After receiving messages the KafkaConsumerActor.processResult passes them to the stages that requested messages for that topic/partition. The stage does not reconsider messages in its buffer when the Kafka broker rebalances a consumer group, and will continue to issue messages that belong to partitions it no longer "owns" to the stream.

@ennru
Copy link
Member Author

ennru commented Oct 21, 2019

This is similar to what the TransactionalSource does with its InflightRecords.

@ennru
Copy link
Member Author

ennru commented Jan 16, 2020

Fixed with #946 and #992

@ennru ennru closed this as completed Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant