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

[store] feature: sled backed raft state #1056

Merged
merged 3 commits into from
Jul 16, 2021

Conversation

drmingdrmer
Copy link
Member

@drmingdrmer drmingdrmer commented Jul 15, 2021

I hereby agree to the terms of the CLA available at: https://datafuse.rs/policies/cla/

Summary

[store] feature: sled backed raft state
  • When starting a MetaNode(and a DFS that depends on a MetaNode),
    assign a on-disk dir for it to store persisted raft state, including:
    node_id, current_term, voted_for.

  • Add: RaftState, which is a disk backed store of raft state.

  • Change: MetaStore::new() now accepts a complete Config instead of a
    single listening addr.

  • Test: add new_test_context() to create a temp env for testing MetaNode
    or DFS, which includes a temp meta store dir, unique port for meta
    service etc.

  • Test: all tests that involves a MetaStore assign a temp dir for meta
    storage.

[store] refactor: move netowk to network.rs
[store] refactor: rename MetaStore field names.

Changelog

  • New Feature

  • Improvement

Related Issues

#271

Fix: #1051

@databend-bot databend-bot added pr-feature this PR introduces a new feature to the codebase pr-improvement labels Jul 15, 2021
@databend-bot
Copy link
Member

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@drmingdrmer drmingdrmer added this to the v0.5 milestone Jul 15, 2021
@drmingdrmer drmingdrmer marked this pull request as ready for review July 15, 2021 18:44
- When starting a MetaNode(and a DFS that depends on a MetaNode),
  assign a on-disk dir for it to store persisted raft state, including:
  `node_id`, `current_term`, `voted_for`.

- Add: RaftState, which is a disk backed store of raft state.

- Change: MetaStore::new() now accepts a complete Config instead of a
  single listening addr.

- Test: add new_test_context() to create a temp env for testing MetaNode
  or DFS, which includes a temp meta store dir, unique port for meta
  service etc.

- Test: all tests that invovles a MetaStore assign a temp dir for meta
  storage.
Copy link
Member

@dantengsky dantengsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@databend-bot
Copy link
Member

CI Passed
Reviewer Approved
Let's Merge

@databend-bot databend-bot merged commit 96e97d2 into databendlabs:master Jul 16, 2021
@drmingdrmer drmingdrmer deleted the refac branch July 16, 2021 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[store/meta]: add disk backed raft-state impl
4 participants