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

Refactor: introducing CommittedVote, NonCommittedVote, and RefVote types #1254

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Oct 12, 2024

Changelog

Refactor: introducing CommittedVote, NonCommittedVote, and RefVote types
  • Introduce Specialized Vote Types:

    • Added CommittedVote and NonCommittedVote to distinguish between votes that have been
      accepted by a quorum and those that have not.
    • Introduced RefVote to provide a reference-based representation of votes, facilitating safer
      and more efficient comparisons.
  • Update Vote Management Logic:

    • Replaced direct usage of Vote with CommittedVote and NonCommittedVote across various
      modules (heartbeat/worker.rs, notification.rs, raft_core.rs, etc.) to enhance type
      safety and clarity.
    • Modified comparison logic to leverage the new vote types, ensuring accurate and meaningful
      ordering based on vote status.
  • Enhance Notification Mechanisms:

    • Updated notification structures to use the new vote types, improving the accuracy of messages
      related to vote responses and higher votes observed.

This change is Reviewable

- **Introduce Specialized Vote Types:**
  - Added `CommittedVote` and `NonCommittedVote` to distinguish between votes that have been
    accepted by a quorum and those that have not.
  - Introduced `RefVote` to provide a reference-based representation of votes, facilitating safer
    and more efficient comparisons.

- **Update Vote Management Logic:**
  - Replaced direct usage of `Vote` with `CommittedVote` and `NonCommittedVote` across various
    modules (`heartbeat/worker.rs`, `notification.rs`, `raft_core.rs`, etc.) to enhance type
    safety and clarity.
  - Modified comparison logic to leverage the new vote types, ensuring accurate and meaningful
    ordering based on vote status.

- **Enhance Notification Mechanisms:**
  - Updated notification structures to use the new vote types, improving the accuracy of messages
    related to vote responses and higher votes observed.
@drmingdrmer drmingdrmer force-pushed the 157-use-committed-and-non-committed-vote branch from 6c91be7 to 39a77dc Compare October 12, 2024 07:06
@drmingdrmer drmingdrmer merged commit 3fe7d9a into databendlabs:main Oct 12, 2024
31 of 32 checks passed
@drmingdrmer drmingdrmer deleted the 157-use-committed-and-non-committed-vote branch October 12, 2024 07:44
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