-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement Raft protocol to replicate KV pairs #10
Open
lnikon
wants to merge
25
commits into
master
Choose a base branch
from
feature/raft
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
2051a9d
Raft leader election in progress
lnikon 10396a7
Implement leader election
lnikon b9b5995
Refactor timer thread
lnikon 614c2bc
A little refactoring
lnikon 2e6374a
Refactor into separate headers & fix bugs
lnikon e0a354b
Implement coderabbit reviews #1
lnikon 2fa9fca
Fix PR reviews & bugs #2
lnikon 0832944
Fix PR reviews #3
lnikon 2b7359e
Refactor election thread & implement log replication
lnikon f53b501
Fix state machine modification during log replication
lnikon 497b88d
Implement persistence
lnikon ee68090
Fix docker image build errors & Implement CR suggestions
lnikon f68e8d1
Implement CR suggestions
lnikon 3372412
Implement CR suggestions
lnikon 1b8b93b
BestPractice improvement
lnikon ff8edca
Check fstream failures when persisting raft's state & code style changes
lnikon 7ca37a9
Support dependency injection for raft classes & prepare for mock testing
lnikon 54f02c9
Graceful shutdown in progress
lnikon d803bec
Bug fixes
lnikon 9d5cd21
Remove unused headers
lnikon d63a8fe
Graceful shutdown in progress
lnikon 0bab68f
Implement graceful shutdown
lnikon ece39ad
Add unit test for leader election
lnikon 0834c89
Fix unsynced access to heartbeat atomic
lnikon cb376b9
Add new unit test
lnikon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ project(zkv) | |
|
||
add_subdirectory(absl) | ||
add_subdirectory(embedded) | ||
add_subdirectory(raft) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.25) | ||
project(zkv) | ||
|
||
add_executable(RaftMain "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp") | ||
set_target_properties(RaftMain PROPERTIES CXX_STANDARD 23) | ||
target_link_libraries(RaftMain PRIVATE DB RaftProtoObjects) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add test configuration for Raft implementation The Raft consensus is a critical component that requires thorough testing. Consider adding test configuration to ensure reliability. Add the following after the existing code: # Add test executable
add_executable(RaftTests "${CMAKE_CURRENT_SOURCE_DIR}/tests/raft_tests.cpp")
set_target_properties(RaftTests PROPERTIES CXX_STANDARD 23)
target_link_libraries(RaftTests PRIVATE
DB
RaftProtoObjects
Catch2::Catch2WithMain
)
# Register with CTest
add_test(NAME raft_tests COMMAND RaftTests) This will help ensure:
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🛠️ Refactor suggestion
Enhance RaftMain debug configuration for multi-node debugging.
The configuration needs improvements for debugging multiple Raft nodes:
Apply this diff:
Add to the end of the file: