#raft #consensus

openraft-rocksstore-compat07

A example v07 compatible implementation of the openraft::RaftStorage trait

4 releases

0.8.3 Mar 19, 2023
0.8.2 Mar 7, 2023
0.8.1 Feb 28, 2023
0.8.0 Feb 28, 2023

#6 in #deserialize-data

Download history 4/week @ 2023-11-01 1/week @ 2023-11-08 1/week @ 2023-11-15 4/week @ 2023-11-22 14/week @ 2023-11-29 4/week @ 2023-12-06 4/week @ 2023-12-13 4/week @ 2023-12-20 9/week @ 2023-12-27 1/week @ 2024-01-17 5/week @ 2024-01-24 4/week @ 2024-01-31 1/week @ 2024-02-07 151/week @ 2024-02-14

161 downloads per month

MIT/Apache

1MB
19K 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

~34–49MB
~842K SLoC