feat(raft): Implement the gRPC version of Raft Network#238
Open
MciG-ggg wants to merge 7 commits intoarana-db:feat/raftfrom
Open
feat(raft): Implement the gRPC version of Raft Network#238MciG-ggg wants to merge 7 commits intoarana-db:feat/raftfrom
MciG-ggg wants to merge 7 commits intoarana-db:feat/raftfrom
Conversation
- Added scripts to start a 3-node Raft cluster - Updated Cargo.lock with new dependencies - Implemented basic API and node logic for Raft consensus algorithm
- Introduced `use_grpc` configuration option in `RaftClusterConfig` to toggle between gRPC and HTTP for node communication. - Updated dependencies in `Cargo.toml` to include `tonic` and `prost` for gRPC support. - Created `build.rs` to compile protobuf definitions for Raft RPC services. - Added `raft.proto` file defining the gRPC service and message types for Raft operations. - Implemented `RaftServiceImpl` struct to handle gRPC requests for voting, appending entries, and installing snapshots. - Modified `KiwiNetworkFactory` to manage gRPC clients instead of HTTP clients. - Updated `RaftApp` to create a gRPC server for handling incoming requests. - Refactored server initialization in `main.rs` to start the gRPC server instead of the HTTP server.
- Moved gRPC service implementations into separate modules: core, admin, and client. - Implemented RaftCoreService for handling core Raft protocol operations (vote, append entries, etc.). - Implemented RaftAdminService for cluster management operations (initialize, add learner, change membership, remove node). - Implemented RaftClientService and RaftMetricsService for client data operations and metrics retrieval. - Updated network layer to use the new gRPC service clients. - Removed the old gRPC service implementation and adjusted the RaftApp to create all gRPC services. - Enhanced error handling and logging throughout the gRPC implementations. - Updated Cargo.toml to include necessary dependencies for gRPC support.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
scripts/start_node_cluster.shwhich can start specific numbers of nodes to build a cluster. Due to the config is not load to the app, the script has to move the kiwi excutable file to several directories to start nodes. This should change when the config file is load to the app.