From dddc73295ac2db66ca51c296d090e327f4e288c5 Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 2 Oct 2025 16:51:28 -0400 Subject: [PATCH] repair task maybe working? --- constellation/src/bin/main.rs | 2 +- constellation/src/storage/rocks_store.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/constellation/src/bin/main.rs b/constellation/src/bin/main.rs index 9596099..c602d85 100644 --- a/constellation/src/bin/main.rs +++ b/constellation/src/bin/main.rs @@ -123,7 +123,7 @@ fn main() -> Result<()> { let rocks = rocks.clone(); let stay_alive = stay_alive.clone(); s.spawn(move || { - let rep = rocks.run_repair(time::Duration::from_millis(1), stay_alive); + let rep = rocks.run_repair(time::Duration::from_millis(0), stay_alive); eprintln!("repair finished: {rep:?}"); rep }); diff --git a/constellation/src/storage/rocks_store.rs b/constellation/src/storage/rocks_store.rs index f75ac71..b015d33 100644 --- a/constellation/src/storage/rocks_store.rs +++ b/constellation/src/storage/rocks_store.rs @@ -358,6 +358,10 @@ impl RocksStorage { let mut maybe_done = false; + let mut write_fast = rocksdb::WriteOptions::default(); + write_fast.set_sync(false); + write_fast.disable_wal(true); + while !stay_alive.is_cancelled() && !maybe_done { // let mut batch = WriteBatch::default(); @@ -386,7 +390,7 @@ impl RocksStorage { let target_id: TargetId = _vr(iter.value().unwrap())?; self.db - .put_cf(&cf, target_id.id().to_be_bytes(), _rv(&target))?; + .put_cf_opt(&cf, target_id.id().to_be_bytes(), _rv(&target), &write_fast)?; any_written = true; iter.next(); } -- 2.51.2