-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change: Add
RaftNetworkV2
, remove feature flag generic-snapshot-data
- Remove `generic-snapshot-data`. The snapshot data trait is now consistently bound to `OptionalSend + 'static`. - Introduction of `RaftNetworkV2::full_snapshot()` for transmitting snapshots in one piece. - Retention of the original chunk-based snapshot transmission API in `RaftNetwork::install_snapshot()`. From this commit onwards: - To use the one-piece snapshot transmission, implement `RaftNetworkV2` when creating a `Raft` instance. - To continue using the chunk-based transmission, implement `RaftNetwork`. Compatibility: - `RaftNetworkV2` is automatically implemented for any `RaftNetwork` if `RaftTypeConfig::SnapshotData` implements `tokio::io::AsyncRead`, `tokio::io::AsyncWrite`, `tokio::io::AsyncSeek`, and `Unpin`. Upgrade tip: - Remove the `generic-snapshot-data` feature flag. - If you prefer using the original chunk-based method, no further action is required. Otherwise, to adopt the new one-piece snapshot transmission: - Replace `RaftNetwork` and `RaftNetworkFactory` with `RaftNetworkV2` and `RaftNetworkFactoryV2`.
- Loading branch information
1 parent
5c83e16
commit 4d0d103
Showing
34 changed files
with
204 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,44 +63,6 @@ jobs: | |
args: --features bench nothing-to-run --manifest-path openraft/Cargo.toml | ||
|
||
|
||
# Run feature specific test for crate openraft. | ||
openraft-features: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- toolchain: "nightly" | ||
features: "generic-snapshot-data" | ||
|
||
|
||
steps: | ||
- name: Setup | Checkout | ||
uses: actions/checkout@v2 | ||
|
||
|
||
- name: Setup | Toolchain | ||
uses: actions-rs/[email protected] | ||
with: | ||
toolchain: "${{ matrix.toolchain }}" | ||
override: true | ||
|
||
|
||
# - A store with defensive checks returns error when unexpected accesses are sent to RaftStore. | ||
# - Raft should not depend on defensive error to work correctly. | ||
- name: Test crate `openraft/` | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --features "${{ matrix.features }}" --manifest-path openraft/Cargo.toml | ||
env: | ||
# Parallel tests block each other and result in timeout. | ||
RUST_TEST_THREADS: 2 | ||
RUST_LOG: debug | ||
RUST_BACKTRACE: full | ||
|
||
|
||
# Run openraft unit test `openraft/` and integration test `tests/`. | ||
openraft-test: | ||
runs-on: ubuntu-latest | ||
|
@@ -409,7 +371,7 @@ jobs: | |
example: | ||
- "memstore" | ||
- "raft-kv-memstore" | ||
- "raft-kv-memstore-generic-snapshot-data" | ||
- "raft-kv-memstore-network-v2" | ||
- "raft-kv-memstore-opendal-snapshot-data" | ||
- "raft-kv-memstore-singlethreaded" | ||
- "raft-kv-rocksdb" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...-memstore-generic-snapshot-data/README.md → ...les/raft-kv-memstore-network-v2/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
//! The Raft network interface. | ||
mod backoff; | ||
mod factory; | ||
#[allow(clippy::module_inception)] mod network; | ||
mod rpc_option; | ||
mod rpc_type; | ||
|
||
pub mod v1; | ||
pub mod v2; | ||
|
||
pub mod snapshot_transport; | ||
|
||
pub use backoff::Backoff; | ||
pub use factory::RaftNetworkFactory; | ||
pub use network::RaftNetwork; | ||
pub use rpc_option::RPCOption; | ||
pub use rpc_type::RPCTypes; | ||
pub use v1::RaftNetwork; | ||
pub use v1::RaftNetworkFactory; |
Oops, something went wrong.