-
Notifications
You must be signed in to change notification settings - Fork 707
proto: don't require proxying for list broker calls #29133
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
base: dev
Are you sure you want to change the base?
Conversation
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 modifies the ListBrokers RPC to no longer require proxying requests to all brokers, preventing failures when individual brokers are down. The change makes node_id in GetBrokerRequest optional (using protobuf optional instead of the -1 sentinel value) and makes build_info and admin_server fields optional in the Broker message, with documentation noting they're only populated for GetBroker RPCs.
Key Changes:
- Changed
GetBrokerRequest.node_idfrom required to optional field - Made
Broker.build_infoandBroker.admin_serveroptional fields that are only populated forGetBrokercalls - Modified
list_brokersimplementation to directly populate broker node IDs without proxying
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| proto/redpanda/core/admin/v2/broker.proto | Changed node_id, build_info, and admin_server to optional fields with updated documentation |
| src/v/redpanda/admin/services/broker.cc | Updated get_broker to check for optional node_id and modified list_brokers to populate only node IDs without proxying |
| tests/rptest/clients/admin/proto/redpanda/core/admin/v2/broker_pb2.py | Regenerated Python protobuf code reflecting the optional field changes |
| tests/rptest/clients/admin/proto/redpanda/core/admin/v2/broker_pb2.pyi | Regenerated Python type stubs with new optional field signatures and methods |
Comments suppressed due to low confidence (1)
src/v/redpanda/admin/services/broker.cc:1
- The comparison
target != -1is now redundant sincenode_idis optional and this code is only reached whenhas_node_id()is true. If the intent was to support-1as a sentinel value for backward compatibility, the current implementation still doesn't handle it properly (it would treat-1as a valid target). Either remove the-1check entirely or add explicit handling for the-1case.
/*
Retry command for Build#78465please wait until all jobs are finished before running the slash command |
42510a7 to
5de3179
Compare
Retry command for Build#78495please wait until all jobs are finished before running the slash command |
Currently a single broker being down means the list broker calls will fail, which is undesirable. To fix this we omit some information in ListBroker RPCs. While this is a semantic breaking change, it's not a wire or generated code breaking change. We also use an `optional` for node_id instead of `-1`, as that's much cleaner. We don't break compatibility here FWIW.
5de3179 to
4c9d721
Compare
michael-redpanda
left a comment
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 - are we going to backport this? Do we have any downstream consumers using this today?
Currently a single broker being down means the list broker calls will
fail, which is undesirable. To fix this we omit some information in
ListBroker RPCs. While this is a semantic breaking change, it's not a
wire or generated code breaking change.
We also use an
optionalfor node_id instead of-1, as that's muchcleaner. We don't break compatibility here FWIW.
Backports Required
Release Notes
Improvements
ListBrokersin the Admin v2 API doesn't require all brokers to be up.