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

fix: use least loaded broker to refresh metadata #2645

Merged
merged 1 commit into from
Sep 12, 2023

Commits on Sep 12, 2023

  1. fix: use least loaded broker to refresh metadata

    Seed brokers never change after client initialization. If the first seed
    broker became stale (still online, but moved to other Kafka cluster),
    Sarama client may use this stale broker to get the wrong metadata. To
    avoid using the stale broker to do metadata refresh, we will choose the
    least loaded broker in the cached broker list which is the similar to
    how the Java client implementation works:
    
    https://github.com/apache/kafka/blob/7483991a/clients/src/main/java/org/apache/kafka/clients/NetworkClient.java#L671-L736
    
    Contributes-to: IBM#2637
    
    Signed-off-by: Hao Sun <haos@uber.com>
    HaoSunUber committed Sep 12, 2023
    Configuration menu
    Copy the full SHA
    98ec384 View commit details
    Browse the repository at this point in the history