Skip to content

Commit e670591

Browse files
committed
Implement tiered storage
This commit adds `TierStore`, a tiered `KVStore` implementation that routes node persistence across three storage roles: - a primary store for durable, authoritative data - an optional backup store for a second durable copy of primary-backed data - an optional ephemeral store for rebuildable cached data such as the network graph and scorer TierStore routes ephemeral cache data to the ephemeral store when configured, while durable data remains primary+backup. Reads and lists do not consult the backup store during normal operation. For primary+backup writes and removals, this implementation treats the backup store as part of the persistence success path rather than as a best-effort background mirror. Earlier designs used asynchronous backup queueing to avoid blocking the primary path, but that weakens the durability contract by allowing primary success to be reported before backup persistence has completed. TierStore now issues primary and backup operations together and only returns success once both complete. This gives callers a clearer persistence guarantee when a backup store is configured: acknowledged primary+backup mutations have been attempted against both durable stores. The tradeoff is that dual-store operations are not atomic across stores, so an error may still be returned after one store has already been updated. Additionally, adds unit coverage for the current contract, including: - basic read/write/remove/list persistence - routing of ephemeral data away from the primary store - backup participation in the foreground success path for writes and removals Note: We skip the Rust-only backup-store builder test when UniFFI bindings are enabled, since backup and ephemeral store configurations are not exposed through FFI yet (wiil be added in #871 follow-up).
1 parent 4aac5e8 commit e670591

3 files changed

Lines changed: 888 additions & 0 deletions

File tree

src/io/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub mod postgres_store;
1212
pub mod sqlite_store;
1313
#[cfg(test)]
1414
pub(crate) mod test_utils;
15+
pub(crate) mod tier_store;
1516
pub(crate) mod utils;
1617
pub mod vss_store;
1718

0 commit comments

Comments
 (0)