Expand description
Consensus and Blob implementations suitable for use with turmoil.
Both implementations function by forwarding calls to a server backend via turmoil::net::TcpStreams. The server backend keeps a simple in-memory state (implemented using MemConsensus and MemBlob, respectively), which it uses to respond to RPCs.
In a turmoil test, both the consensus and the blob server should be run as separate hosts. This gives turmoil the ability to partition and crash them independently, for the maximum amount of interesting interleaving.
use mz_persist::turmoil::{BlobState, ConsensusState, serve_blob, serve_consensus};
let mut sim = turmoil::Builder::new().build();
sim.host("consensus", {
let state = ConsensusState::new();
move || serve_consensus(7000, state.clone())
});
sim.host("blob", {
let state = BlobState::new();
move || serve_blob(7000, state.clone())
});To connect to these servers, use the following PersistLocation:
ⓘ
PersistLocation {
blob_uri: "turmoil://blob:7000".parse().unwrap(),
consensus_uri: "turmoil://consensus:7000".parse().unwrap(),
}Structs§
- Blob
Config - Configuration for a TurmoilBlob.
- Blob
State - State of a turmoil blob server.
- Consensus
Config - Configuration for a TurmoilConsensus.
- Consensus
State - State of a turmoil consensus server.
- Turmoil
Blob - A Blob implementation for use in turmoil tests.
- Turmoil
Consensus - A Consensus implementation for use in turmoil tests.
Functions§
- serve_
blob - Run a turmoil blob server.
- serve_
consensus - Run a turmoil consensus server.