Skip to content
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

add API to list voters #411

Merged
merged 1 commit into from
Jan 23, 2024
Merged

add API to list voters #411

merged 1 commit into from
Jan 23, 2024

Conversation

illotum
Copy link
Collaborator

@illotum illotum commented Jan 23, 2024

Proposed Changes

This is a small addition, high-level API to list voters of a Ra cluster. To be used wherever an active quorum list is needed instead of ra:members.

Types of Changes

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, appearance)

Checklist

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

@michaelklishin michaelklishin merged commit d5a7c97 into rabbitmq:main Jan 23, 2024
7 checks passed
@michaelklishin michaelklishin added this to the 2.8.0 milestone Jan 23, 2024
@michaelklishin
Copy link
Member

michaelklishin commented Jan 23, 2024

@illotum our team would like to ask for another API extension. This one is fine for where it will be used in RabbitMQ, so I guess we can keep it.

The function we'd like to see is a version of ra:members/1 that would return a map with a more detailed view of cluster members.

ra:members_with_details/1 and ra:members_ext/1 are two named proposed. WDYT?

@kjnilsson
Copy link
Contributor

On second thought I think ra:members_info/1 would be a good name, effectively returning what's in the cluster key of the ra_state() map. The leader doesn't update it's own ra_peer_state() so that needs to be filled in on the fly.

@illotum
Copy link
Collaborator Author

illotum commented Jan 23, 2024

For sure! I usually lean towards minimal changes, but the extended API covers all my needs and more.

@illotum illotum deleted the list-voters branch January 24, 2024 00:57
@kjnilsson
Copy link
Contributor

For sure! I usually lean towards minimal changes, but the extended API covers all my needs and more.

I think with all the peer info we can probably make better external decision on stuff like member changes without further probing. I have on a couple of occasions wished I could get this information in an easier way. ra:voters/1 is very specific the ra module API is growing quite large and having a more generic function avoids us having to add yet another function in the future.

@illotum
Copy link
Collaborator Author

illotum commented Jan 24, 2024

Following on the rabbitmq-server#10394 thread, lets revert this merge then and I'll go ahead with a proper member_info.

@michaelklishin
Copy link
Member

Done.

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.

None yet

3 participants