Skip to content

Commit 04855d7

Browse files
committed
fixup! Implement tiered storage
Respect inner sync store semantics in TierStore and FFI store bridging Here we rework TierStore's `KVStoreSync` implementation so that synchronous calls no longer route through TierStore's own runtime and async helpers. Instead, sync operations now delegate through dedicated sync internal helpers that call the underlying stores' `KVStoreSync` methods directly. This preserves backend-specific sync behavior for wrapped stores, including stores that intentionally use a different execution strategy for synchronous operations than for async ones. In particular, it avoids forcing inner stores through TierStore's runtime when the inner store already defines its own sync semantics. As part of this change: - remove the `Runtime` dependency from `TierStore` - update `TierStore::new` and its call sites accordingly - add sync internal helpers for read/write/remove/list routing - add sync primary/backup helpers mirroring the async dual-store behavior - share ephemeral routing and primary/backup result handling across sync and async paths to reduce duplication We also update `FfiDynStore`'s sync write/remove path to avoid directly calling `tokio::sync::Mutex::blocking_lock` on a Tokio runtime worker thread. The sync path now goes through a small helper that uses `block_in_place` when already inside a runtime, preventing panics in runtime-backed test scenarios such as `start_stop_reinit`, and many others. The net effect is: - TierStore sync operations now honor the inner store's sync contract - FFI-backed sync writes/removals no longer panic when invoked from within a Tokio runtime - TierStore construction and tests are simplified by dropping the now-unused runtime plumbing
1 parent e5e1378 commit 04855d7

File tree

2 files changed

+326
-90
lines changed

2 files changed

+326
-90
lines changed

src/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,7 @@ impl NodeBuilder {
838838
};
839839

840840
let ts_config = self.tier_store_config.as_ref();
841-
let mut tier_store =
842-
TierStore::new(primary_store, Arc::clone(&runtime), Arc::clone(&logger));
841+
let mut tier_store = TierStore::new(primary_store, Arc::clone(&logger));
843842
if let Some(config) = ts_config {
844843
config.ephemeral.as_ref().map(|s| tier_store.set_ephemeral_store(Arc::clone(s)));
845844
config.backup.as_ref().map(|s| tier_store.set_backup_store(Arc::clone(s)));

0 commit comments

Comments
 (0)