-
Notifications
You must be signed in to change notification settings - Fork 400
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
How to use this lib? #402
Comments
Basically you need to see batch_raft RPC implement: Receiver: https://github.com/tikv/tikv/blob/master/src/server/service/kv.rs#L628-L664 And snapshot handling: https://github.com/tikv/tikv/blob/master/src/server/snap.rs. Providing a details and minimal example in raft-rs using gRPC and raft-rs would certainly help. |
The Example and docs don't show the border in this lib. For example, I spend much time learning how nodes connect to and know each other automatically(I thought the lib has default way to broadcast message, the only things I provided is IP or Host) , finnally I found I should implement broadcasting messages. On the other hand, seriously, if I did not write the full program including basic raft and upper kv-db, I totally don't know what should do with the lib. "Server gets requests and wait another thread handles these requests message with raft-rs" is not intuitive. It needs docs apart from example. The example may has somethings wrong. It's another issue: #412 |
You can check and use some frameworks built on top of raft-rs, such as ritedb/riteraft . This hides most of the work details and can help you get a good start. A simple Raft HashStore Service example is written in ~160 lines of code, you can try to run it. In addition, async-raft has a brief document. Although its design is different from raft-rs, it is still a reference material worth reading. |
@PsiACE If you can send a PR, we can list it as an item under "Projects using the Raft crate". |
I have written a simple example about how to use this lib, dkvrr which use real gRPC framework. My toy project is still under development and need helpful suggestions. |
I'd like to add to this: not only are @HichuYamichu 's comments reflective of my own experience trying to figure out how to use this crate, I'm not thrilled about being forced to use |
@sp1ff You can opt out slog by configuring raft as
raft-rs is designed and implemented as simple as possible, there is no RPC logics in the library at all. So you can use any RPC you like to build up network layers. |
I have ported riteraft, which was originally created by @PsiACE, to riteraft-py. I think riteraft-py's example code is written in Python instead of Rust, making it easier to read and understand for beginners. However, the current version of riteraft contains several bugs from the original implementation. As I am not a distributed system expert, I am facing difficulties in resolving these issues. I would greatly appreciate it if someone could assist me with this problem by any chance. |
Or more specifically how does one build transport component?
I'm feeling kind of lost after reading docs, readme and examples as none of them (at least to my knowledge) shows/points to information about transport implementation. Readme mentions gRPC but I couldn't find any further information on the matter besides raft-rs/proto/, which isn't much on its own. TiKv is too big to be a valid reference for starters and etcd raftexample although helpful shows only http api and uses Go implementation.
I believe some information about transport layer should be present either in docs, examples or readme (as it is the case for log and state machine parts). If that's the case and I've simply missed it this can be closed right away.
The text was updated successfully, but these errors were encountered: