-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[KIP-1102] Enable clients to rebootstrap based on timeout or error code #4981
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
Draft
emasab
wants to merge
50
commits into
master
Choose a base branch
from
dev_kip1102
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Kafka protocol allows for brokers to have multiple host:port pairs for a given node Id, e.g. see UpdateMetadata request which contains a live_brokers list where each broker Id has a list of host:port pairs. It follows from this that the thing that uniquely identifies a broker is its Id, and not the host:port. The behaviour right now is that if we have multiple brokers with the same host:port but different Ids, the first broker in the list will be updated to have the Id of whatever broker we're looking at as we iterate through the brokers in the Metadata response in rd_kafka_parse_Metadata0(), e.g. Step 1. Broker[0] = Metadata.brokers[0] Step 2. Broker[0] = Metadata.brokers[1] Step 3. Broker[0] = Metadata.brokers[2] A typical situation where brokers have the same host:port pair but differ in their Id is if the brokers are behind a load balancer. The NODE_UPDATE mechanism responsible for this was originally added in b09ff60 ("Handle broker name and nodeid updates (issue #343)") as a way to forcibly update a broker hostname if an Id is reused with a new host after the original one was decommissioned. But this isn't how the Java Kafka client works, so let's use the Metadata response as the source of truth instead of updating brokers if we can only match by their host:port.
Brokers that are not in the metadata should be purged from the internal client lists. This helps to avoid annoying "No route to host" and other connection failure messages. Fixes #238.
Co-authored-by: Emanuele Sabellico <[email protected]>
Co-authored-by: Emanuele Sabellico <[email protected]>
rkb creation.
as it's now set only on creation and not modified anymore
mock cluster
and move documentation
ones, except for currently used bootstrap broker. Wait decommissioned threads after they've stopped instead of on termination.
triggered when a broker is removed without terminating the client.
and cluster roll
remove left references when decommissioning a broker and avoid it's selected as leader again or that partitions are delegated to it
broker for the all brokers down error, to send the error in all the cases
🎉 All Contributor License Agreements have been signed. Ready to merge. |
5bff66d
to
313f6a0
Compare
2c542b0
to
b3c8716
Compare
triggered when a broker is removed without terminating the client. Move the operation after the interceptors to avoid blocking the main thread.
Exclude terminating brokers
… same id isn't causing problems
313f6a0
to
b845ac2
Compare
b3c8716
to
d072e63
Compare
9ff24f7
to
c1f0996
Compare
c1f0996
to
f99417f
Compare
…sible to await for the correct list of brokers in all tests given since decommissioning brokers are excluded from that list
f99417f
to
1e51911
Compare
f294613
to
3eb055f
Compare
1e51911
to
a64cd5b
Compare
a64cd5b
to
7ff294e
Compare
3eb055f
to
86fd198
Compare
return sorted broker ids
7ff294e
to
8762319
Compare
86fd198
to
5c90461
Compare
test log interceptor. Used the test log interceptor for test 0151 too
8762319
to
6dbeae7
Compare
5c90461
to
853b478
Compare
6dbeae7
to
0aede38
Compare
853b478
to
4c12f61
Compare
e9889e5
to
919a9bc
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.