KAFKA-8275; Take throttling into account when choosing least loaded node#6619
Conversation
rajinisivaram
left a comment
There was a problem hiding this comment.
@hachikuji Thanks for the PR, LGTM
|
retest this please |
…s-hashcode * apache-github/trunk: KAFKA-8158: Add EntityType for Kafka RPC fields (apache#6503) MINOR: correctly parse version OffsetCommitResponse version < 3 KAFKA-8284: enable static membership on KStream (apache#6673) KAFKA-8304: Fix registration of Connect REST extensions (apache#6651) KAFKA-8275; Take throttling into account when choosing least loaded node (apache#6619) KAFKA-3522: Interactive Queries must return timestamped stores (apache#6661) MINOR: MetricsIntegrationTest should set StreamsConfig.STATE_DIR_CONFIG (apache#6687) MINOR: Remove unused field in `ListenerConnectionQuota` KAFKA-8131; Move --version implementation into CommandLineUtils (apache#6481) KAFKA-8056; Use automatic RPC generation for FindCoordinator (apache#6408) MINOR: Remove workarounds for lz4-java bug affecting byte buffers (apache#6679) KAFKA-7455: Support JmxTool to connect to a secured RMI port. (apache#5968) MINOR: Document improvement (apache#6682) MINOR: Fix ThrottledReplicaListValidator doc error. (apache#6537) KAFKA-8306; Initialize log end offset accurately when start offset is non-zero (apache#6652)
…ode (apache#6619) If a node is currently throttled, we should take it out of the running for `leastLoadedNode`. Additionally, current logic seems to favor connecting to new nodes rather than using existing connections which have one or more in flight requests. The javadoc is slightly vague about whether this is expected, but it seems not. Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
|
The leastLoadedNode() function has a bug during the consumer process starting period. The function sendMetadataRequest() called by getTopicMetadataRequest() uses a random node which maybe faulty since every node‘s state recorded in the client thread is not ready yet. It happened in my production environment during my consumer thread restarting and meanwhile one of the KAFKA server node is dead. |
I'm using the kafka-client-2.0.1.jar. I have checked the source code of higher versions and the issue still exists. |
If a node is currently throttled, we should take it out of the running for
leastLoadedNode. Additionally, current logic seems to favor connecting to new nodes rather than using existing connections which have one or more in flight requests. The javadoc is slightly vague about whether this is expected, but it seems not.Committer Checklist (excluded from commit message)