#raft-consensus #raft #raft-storage #consensus #upgrade #openraft #compatibility

openraft-rocksstore-compat07

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

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

#1694 in Asynchronous

Download history 61/week @ 2024-02-19 5/week @ 2024-02-26 124/week @ 2024-03-04 41/week @ 2024-03-11

231 downloads per month

MIT/Apache

1MB
20K 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–52MB
~1M SLoC