tikv / raft-rs

Raft distributed consensus algorithm implemented in Rust.
Apache License 2.0
2.86k stars 391 forks source link

feature: validate term value #513

Open GuyLewin opened 1 year ago

GuyLewin commented 1 year ago

Fixes #511

GuyLewin commented 1 year ago

@BusyJay do you agree with my change in src/storage.rs?: https://github.com/tikv/raft-rs/blob/b0a374060334a35442e7da1f3769599de7a040ed/src/storage.rs#L422-L423 ?

If so - it breaks a lot of tests but I can go over them and fix them. I just don't want to do it if it's the incorrect fix since it'll require some manual work.

BusyJay commented 1 year ago

MemStorage is supposed to be used for tests, change it or not are OK to me.