raft-rs icon indicating copy to clipboard operation
raft-rs copied to clipboard

Suggestion: Provides test suite for ensuring the storage implementation is correct

Open jopemachine opened this issue 1 year ago • 1 comments

I am currently developing a high-level Raft framework based on raft-rs, as shown below. https://github.com/lablup/raftify

One thing I've realized while developing this framework is that even a slightly incorrect storage implementation can lead to totally unexpected bugs in certain scenarios.

It seems like openraft provides a test suite that allows the storage developers to test their own custom storage, as shown in this link to prevent such situations.

I think passing these test suite can alleviate the anxiety storage developers might have about encountering unforeseen errors in specific scenarios.

Documentation about this: https://docs.rs/openraft/latest/openraft/docs/getting_started/index.html#ensure-the-implementation-of-raftstorage-is-correct

I think it would be very helpful if raft-rs provide a similar test suite if possible.

jopemachine avatar Mar 11 '24 06:03 jopemachine

Good idea! One approach is to adapt the implementations in

https://github.com/tikv/raft-rs/blob/65a00620d80a89603c3358fd4b90265a692ae767/src/storage.rs#L522-L813

to accept arbitrary engine. Actually, TiKV itself adapts these cases to test its own PeerStorage in the first version.

BusyJay avatar Mar 11 '24 07:03 BusyJay