Skip to content

Commit 788804c

Browse files
committed
chore: enable WALs for recovering from ungraceful shutdowns
1 parent 29fe1b7 commit 788804c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

madara/crates/client/db/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ impl<D: MadaraStorage> MadaraBackendWriter<D> {
752752
.flush_every_n_blocks
753753
.is_some_and(|flush_every_n_blocks| block_number.checked_rem(flush_every_n_blocks) == Some(0))
754754
{
755-
tracing::debug!("Flushing.");
755+
tracing::info!("🌊 Flushing.");
756756
self.inner.db.flush().context("Periodic database flush")?;
757757
}
758758

madara/crates/client/db/src/rocksdb/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ struct RocksDBStorageInner {
8686

8787
impl Drop for RocksDBStorageInner {
8888
fn drop(&mut self) {
89-
tracing::debug!("⏳ Gracefully closing the database...");
89+
tracing::info!("⏳ Gracefully closing the database...");
9090
self.flush().expect("Error when flushing the database"); // flush :)
9191
self.db.cancel_all_background_work(/* wait */ true);
9292
}
@@ -191,8 +191,9 @@ impl RocksDBStorage {
191191
ALL_COLUMNS.iter().map(|col| ColumnFamilyDescriptor::new(col.rocksdb_name, col.rocksdb_options(&config))),
192192
)?;
193193

194+
// TODO(prakhar, 10/11/2025): update the name of the variable
194195
let mut writeopts_no_wal = WriteOptions::new();
195-
writeopts_no_wal.disable_wal(true);
196+
writeopts_no_wal.disable_wal(true); // Disabling WAL
196197
let inner = Arc::new(RocksDBStorageInner { writeopts_no_wal, db, config: config.clone() });
197198

198199
let head_block_n = inner.get_chain_tip_without_content()?.and_then(|c| match c {

0 commit comments

Comments
 (0)