-
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
Conversation
🎉 All Contributor License Agreements have been signed. Ready to merge. |
5bff66d
to
313f6a0
Compare
2c542b0
to
b3c8716
Compare
313f6a0
to
b845ac2
Compare
b3c8716
to
d072e63
Compare
b845ac2
to
aeda39e
Compare
d072e63
to
2de18f3
Compare
aeda39e
to
620aa32
Compare
2de18f3
to
02733a7
Compare
1428df0
to
ee212c1
Compare
02733a7
to
c40e9c6
Compare
f99417f
to
1e51911
Compare
f294613
to
3eb055f
Compare
a64cd5b
to
7ff294e
Compare
3eb055f
to
86fd198
Compare
7ff294e
to
8762319
Compare
86fd198
to
5c90461
Compare
8762319
to
6dbeae7
Compare
5c90461
to
853b478
Compare
6dbeae7
to
0aede38
Compare
853b478
to
4c12f61
Compare
e9889e5
to
919a9bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements rebootstrap functionality for clients when metadata retrieval fails due to a timeout or a specific error code. Key changes include:
- Adding a new special error action to trigger immediate rebootstrap in the metadata request error path.
- Incrementing the metadata API version from 12 to 13 and updating all dependent components (mock handlers, configuration, and documentation).
- Introducing a new configuration property and timer restart function to control rebootstrap timing.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/rdkafka_request.c | Updated error handling to invoke rebootstrap upon special error condition. |
src/rdkafka_mock_handlers.c | Modified mock responses to support API version 13 and handle error conditions gracefully. |
src/rdkafka_metadata.c | Added reading of top-level error codes and rebootstrap timer restart after metadata parse. |
src/rdkafka_int.h & src/rdkafka.c | Introduced new macros and a timer restart function for rebootstrap. |
src/rdkafka_conf.h & src/rdkafka_conf.c | Added a new configuration property for rebootstrap trigger timeout. |
INTRODUCTION.md, CONFIGURATION.md, CHANGELOG.md | Updated documentation to reflect changes supporting rebootstrap. |
8a94873
to
468a55e
Compare
c97b56a
to
29e814e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass related to code.
f2728b3
to
9e6661d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going through test cases.
## Enhancements and Fixes | ||
|
||
* [KIP-899](https://cwiki.apache.org/confluence/display/KAFKA/KIP-899%3A+Allow+producer+and+consumer+clients+to+rebootstrap) Allow producer and consumer clients to rebootstrap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be upgrading the release notes as well. How should we do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean the release in GitHub? I can modify it after merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
src/rdkafka_mock_handlers.c
Outdated
if (rkbuf->rkbuf_reqhdr.ApiVersion >= 1) { | ||
/* Response: Brokers.Rack (Matt's going to love this) */ | ||
rd_kafka_buf_write_str(resp, mrkb->rack, -1); | ||
if (!err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put every things in !err
if condition instead of adding !err
to every conditions.
src/rdkafka_mock_handlers.c
Outdated
@@ -1378,7 +1386,7 @@ static int rd_kafka_mock_handle_Metadata(rd_kafka_mock_connection_t *mconn, | |||
&IncludeTopicAuthorizedOperations); | |||
} | |||
|
|||
if (list_all_topics) { | |||
if (!err && list_all_topics) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
src/rdkafka_mock_handlers.c
Outdated
@@ -1389,7 +1397,7 @@ static int rd_kafka_mock_handle_Metadata(rd_kafka_mock_connection_t *mconn, | |||
mtopic->id, mtopic->name, mtopic, mtopic->err); | |||
} | |||
|
|||
} else if (requested_topics) { | |||
} else if (!err && requested_topics) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
f96b7a2
to
3f6e2fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits.
included the `metadata.recovery.strategy=none` in the cases that can generate a fatal error. Mock cluster Metadata RPC upgrade to v13 and support for the forcing a top-level error code
string as bootstrap servers or with both bootstrap servers and manually added brokers
metadata.recovery.strategy=none and don't re-bootstrap at all in that case
78dd3b4
to
f94ffd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!.
Thanks @emasab |
No description provided.