Skip to content

Conversation

emasab
Copy link
Contributor

@emasab emasab commented Feb 28, 2025

No description provided.

@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_kip899 branch 5 times, most recently from f99417f to 1e51911 Compare March 28, 2025 16:02
@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_kip1102 branch 2 times, most recently from f294613 to 3eb055f Compare March 31, 2025 09:33
@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_kip899 branch 2 times, most recently from a64cd5b to 7ff294e Compare March 31, 2025 10:05
@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_kip899 branch 2 times, most recently from e9889e5 to 919a9bc Compare April 1, 2025 17:52
@emasab emasab requested a review from a team as a code owner April 24, 2025 14:57
Copy link

@Copilot Copilot AI left a 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.

Copy link
Member

@pranavrth pranavrth left a 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.

@airlock-confluentinc airlock-confluentinc bot force-pushed the dev_kip1102 branch 2 times, most recently from f2728b3 to 9e6661d Compare June 13, 2025 07:43
Copy link
Member

@pranavrth pranavrth left a 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
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

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) {
Copy link
Member

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.

@@ -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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@@ -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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Copy link
Member

@pranavrth pranavrth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits.

emasab added 14 commits June 18, 2025 23:01
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
Copy link
Member

@pranavrth pranavrth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!.

@pranavrth
Copy link
Member

Thanks @emasab

@emasab emasab merged commit 3137946 into master Jun 18, 2025
2 checks passed
@emasab emasab deleted the dev_kip1102 branch June 18, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants