-
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
Module shuffling and organizing #125
Comments
@breeswish I know you looked at build performance on TiKV, maybe you can have a look and give a LGTM if you think it's a good thing to do? |
I like this proposal! For TiKV, currently one of the slow cause might be rust-rocksdb, which requires a full fresh build of rocksdb and spend a lot of time. |
@breeswish Okay. :) I'll start to migrate Raft-rs in this direction over time. Other PRs are welcome to contribute to this! |
@Hoverbear I'll start to spilt |
@Fullstop000 That's great! Thanks! Do you think we can write up some technical details about Follower Replication? I think it's deserving of a full TiKV RFC (https://github.com/tikv/rfcs/). I'd be happy to help you with that. Maybe we can connect on wechat? |
Oh it's so cool having a chance to propose a RFC about it. But I'm still considering about details of the implementation, maybe we can discuss this later. |
@Fullstop000 It is very exciting! Why don't you let me know when you've considered and we can set up a call to discuss. |
Reorganize some of the modules to have their own files and directories.
In general:
RawNode
struct and implementations.)use
statements.INVALID_ID
)enum Foo { Bar, Baz }
. (If it has implementations beyond 1-2 functions split it off)$NAME/{mod, tests}.rs
pair).Rationale
In TiKV we've been seeing a lot of long build times and one optimization to this is splitting up large files. Since raft is a considerably smaller crate it's easy to test our ideas here. At the same time, Raft has some very large files which may be both intimidating and confusing to navigate for potential contributors.
Benefits
Process
In some cases, we should to split files because they hold large structure definitions that can be split up.
For example,
src/progress.rs
contains the structsProgress
andProgressSet
, as well asInflights
.Split modules with several non-trivial structures. In our example,
src/progress.rs
becomessrc/progress/{mod, progress, progress_set, inflights}.rs
There are also modules that are very large due to large test suites etc. They can be split up. For example,
src/raft.rs
contains a large#[test]
module.Extract large test suites into their own files. In our example all of the
#[test]
code can go in atests
file.src/raft.rs
becomessrc/raft/{mod, tests}.rs
.The text was updated successfully, but these errors were encountered: