-
Notifications
You must be signed in to change notification settings - Fork 579
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
[admin] Get leaders info request #4259
Conversation
5d5f4d8
to
39a8be1
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.
everything looks good, but I think it's worth discussing if this needs to go under the /debug
path. this information is largely available already via Kafka's MetadataRequest so it is effectively already not merely debug-level information and could live at a more first-class path (if it isn't all already available via Kafka API).
just as a simple example (we don't need to do this exactly), GET /v1/partitions
returns nearly the exact set of information for local partitions, but could be updated to return everything for GET /v1/partitions?query=all
or GET /v1/cluster/partitions
.
wdyt?
EDIT: I was thinking that Kafka's MetadataRequest
didn't return the leader info for an all-topics request but @mmaslankaprv showed me where that's happening. That request uses the leader table info. So it may be sufficient for this case.
I think there's value in having a debug endpoint that is specifically peeking at a particular data structure, asking "who does the leaders table think is leader?" rather than the more generic "who is leader?" that might be answered different ways, such as asking the local raft groups. In that context, maybe the endpoint should be /v1/debug/partition_leaders_table to reflect that it's really more of a direct data structure dump |
I like it. It is more clearly what will be returned |
I think it should be in |
39a8be1
to
939d3a8
Compare
This is true of many admin APIs. EDIT: As @jcsp says |
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. there is a field that is set twice in the admin server but other than that 👍
This debug API to understand what current node thinks about leaders. User can execute it by usung admin API. Becasue it is debug request we only execute it on one core, without merging ans.
939d3a8
to
aef23b6
Compare
info.previous_leader = leader_info.previous_leader.has_value() | ||
? leader_info.previous_leader.value() | ||
: -1; |
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.
@VadimPlh what is previous leader and why is it exposed?
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.
It is from partition_leaders_table::leader_meta
:
// previous leader id, this is empty if and only if there were no leader
// elected for the topic before
Do we have problems with this?
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.
no it's ok, just surprising that we track it and that we want to expose it through http. thanks for explaining.
Cover letter
This debug API to understand what current node thinks about leaders.
Because it is debug request we only execute it on one core, without merging ans.
Release notes
/v1/debug/partition_leaders_table