Consider production ready for timestamp oracle? #1161
-
I'm interested in making a timestamp oracle in rust, and looking at using this crate instead of tikv's raft as this looks far easier to use and forget about. I'm curious on whether this would be something advised against. I know the API my change before 1.0.0, but I'm curious if the maintainers would have concerns about testing, examples lacking extra instrumentation details (e.g. is there something non-obvious I have to add to detect failures and such, esp with storage), etc. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Openraft provides a very basic But internal the implementation it can not be tested. An real world production should be very careful with the storage. For example, it is crucial that the storage system does not re-order any IO operations: if An obvious mistake would be spawning a Timestamp Project and OpenRaftOpenRaft is suitable for your timestamp project. However, to achieve optimal performance, some form of batching should be implemented on top of Raft. Using a single Raft log entry to generate one timestamp can only achieve approximately x*10 kilo TPS. |
Beta Was this translation helpful? Give feedback.
Openraft provides a very basic
RaftLogStorage
implementation test to ensure the implementation works as expected.https://github.com/datafuselabs/openraft/blob/3ae6b4bfe2d13e633e437373f6c1b716b167bfa3/stores/memstore/src/test.rs#L21-L24
But internal the implementation it can not be tested. An real world production should be very careful with the storage.
The doc of the
RaftLogStorage
explained the requirement the application must achieve.For example, it is crucial that the storage system does not re-order any IO operations: if
save_vote()
is called beforeappend()
, thensave_vote()
must be flushed to disk first beforeappend()
. Otherwise, the consensus cannot be guaranteed.An obvious mi…