Skip to content

Consuming from partitions per leader is unbalanced #141

@xxzefgh

Description

@xxzefgh

Looking at implementation here:
https://github.com/platformatic/kafka/blob/main/src/clients/consumer/messages-stream.ts#L364-L406

fetch requests include all assigned partitions for each leader, which results in some partitions advance much faster than the others. Once partitions catch up to current offsets, only then are other partitions allowed to advance. My guess is that if one partition can saturate maxBytes, other partitions get ignored on the server. This differs from Java implementation, where they don't include partitions in a fetch request that already have records in a local buffer.

Quick look at this method should make my point clear:

https://github.com/apache/kafka/blob/b1b330e664ce6380adec873c410a36ef4664206b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractFetch.java#L421-L488

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogThe issue will be solved in the futureenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions