5 releases
0.8.9 | Mar 6, 2024 |
---|---|
0.8.3 | Mar 19, 2023 |
0.8.2 | Mar 7, 2023 |
0.8.1 | Feb 28, 2023 |
0.8.0 | Feb 28, 2023 |
#1338 in Asynchronous
150 downloads per month
1MB
21K
SLoC
openraft-rockcsstore-0708
This is an example RaftStorage
implementation illustrating how to upgrade an application based on openraft-0.7 to openraft-0.8.
In this example, it assumes there is an on-disk rocksdb dir that backs an 0.7 application, and the compatible 0708 should be able to read data from this dir and write data to it.
lib.rs
:
This is an example implementation of the RaftStorage
trait for an application that
needs to upgrade from openraft v0.7 to v0.8.
Openraft v0.8 introduced several changes to the data types related to persistent data. This
example demonstrates how to upgrade the implementation of the storage without requiring any
modifications to the on-disk data, using the openraft::compat
compatibility layer.
This is a modified version of rocksstore that tries to
deserialize data into a compatible type, such as compat07::LogId
, when reading data from
rocksdb, and then upgrade it to the latest format. You can find usages of compat07::*
that are
used in this implementation to provide compatibility with older data.
Dependencies
~37–50MB
~1M SLoC