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

Change: Membership::new_with_defaults() #1275

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Dec 14, 2024

Changelog

Change: Membership::new_with_defaults()

Add new method Membership::new_with_defaults() that creates
Membership using C::Node::default() to build nodes. And the existing
method Membership::new() does not require C::Node: Default any more.
The corresponding change includes it Membership::new() now returns a
NodeNotFound error if the the given nodes do not include all of the
given Voter ids.

Other changes:

  • Add error MembershipError to represent errors occuring during
    building a Membership.

  • Remove IntoNodes implementations for BTreeSet. Add IntoNodes for
    HashMap<NID, N>.

Upgrade tip:

  • Calls to Membership::new() should provide all nodes(Voters and
    Learners), and deal with the returned Result.

  • Switch to using Membership::new_with_defaults() when needed if
    C::Node implements Default


This change is Reviewable

Add new method `Membership::new_with_defaults()` that creates
`Membership` using `C::Node::default()` to build nodes. And the existing
method `Membership::new()` does not require `C::Node: Default` any more.
The corresponding change includes it `Membership::new()` now returns a
`NodeNotFound` error if the the given nodes do not include all of the
given Voter ids.

Other changes:

- Add error `MembershipError` to represent errors occuring during
  building a `Membership`.

- Remove `IntoNodes` implementations for `BTreeSet`. Add `IntoNodes` for
  `HashMap<NID, N>`.

Upgrade tip:

- Calls to `Membership::new()` should provide all nodes(Voters and
  Learners), and deal with the returned `Result`.

- Switch to using `Membership::new_with_defaults()` when needed if
  `C::Node` implements `Default`
@drmingdrmer drmingdrmer merged commit 03437e1 into databendlabs:main Dec 17, 2024
31 of 32 checks passed
@drmingdrmer drmingdrmer deleted the 173-membership branch December 17, 2024 03:43
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.

1 participant