Spectroscope
Consistency checkers for distributed systems testing.
Spectroscope verifies that operation histories from distributed systems conform to expected consistency models. This is a port of Jepsen's set-full workload linearizability checker.
Installation
[]
= "0.1"
Usage
use ;
use ;
// Workload set value type
;
// Build a history of operations from your distributed system
let mut history = new;
// Process 0 adds element 1
history.push;
history.push;
// ^ ^^^^^^ ^^^^^^ ^^^^^^^^^^^^
// | | | timestamp relative to test start
// | | value being added
// | process id
// operation index
// Process 1 reads and sees the element
history.push;
history.push;
// Check the history for consistency violations
let result = default.check;
assert_eq!;
assert_eq!; // 1 element confirmed visible
assert_eq!; // no elements lost
What it checks
The set-full checker tracks elements through add and read operations:
- Stable: Element is visible in all reads after being added
- Lost: Element was confirmed added but later disappeared
- Stale: Element took multiple reads to become visible (non-linearizable)
- Never-read: Element was added but no subsequent reads occurred
A history is valid if no elements are lost (and no stale elements when linearizable mode is enabled).
Linearizable mode
For strict linearizability, elements must appear immediately after being added:
let checker = linearizable;
let result = checker.check;
// Fails if any element has non-zero visibility latency
License
EPL-1.0