From 363a2835f0723fcbd2ede140c71d4806fd600379 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Tue, 9 Apr 2024 19:02:34 +1200 Subject: [PATCH] Warn if events are not aligned --- chorus-lib/src/store/lmdb/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chorus-lib/src/store/lmdb/mod.rs b/chorus-lib/src/store/lmdb/mod.rs index 9740ef3..ee88cfc 100644 --- a/chorus-lib/src/store/lmdb/mod.rs +++ b/chorus-lib/src/store/lmdb/mod.rs @@ -151,6 +151,11 @@ impl Lmdb { pub fn log_stats(&self) -> Result<(), Error> { let txn = self.read_txn()?; + + if !self.get_if_events_are_aligned()? { + log::warn!("Events are not aligned on 8-byte offsets. You should run `chorus_compress` to rebuild your data (but it will keep working regardless)"); + } + if let Ok(count) = self.i_index.len(&txn) { log::info!("Index: id ({} entries, {} bytes)", count, count * (32 + 8)); }