Skip to content

Commit 7d1e12c

Browse files
committed
Do not force compact rocksdb on startup
We have realized that force compacting an archive node with more than 600GB of disk is not such a great idea :) It takes up to 1h and 30min for the node to finish this task. Subsequent starts are also not faster..
1 parent b9343bc commit 7d1e12c

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

kvdb-rocksdb/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ The format is based on [Keep a Changelog].
66

77
## [Unreleased]
88

9-
## [0.20.2] - 2025-11-17
9+
## [0.20.2] - 2025-11-28
10+
- Do not force compact on startup of a node [#951](https://github.com/paritytech/parity-common/pull/951)
1011
- Make snappy and jemalloc configurable features [#950](https://github.com/paritytech/parity-common/pull/950)
1112

1213
## [0.20.1] - 2025-11-07

kvdb-rocksdb/src/lib.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ impl Database {
354354
Self::open_primary(&opts, path.as_ref(), config, column_names.as_slice(), &block_opts)?
355355
};
356356

357-
let db = Database {
357+
Ok(Database {
358358
inner: DBAndColumns { db, column_names },
359359
config: config.clone(),
360360
opts,
@@ -363,14 +363,7 @@ impl Database {
363363
block_opts,
364364
stats: stats::RunningDbStats::new(),
365365
last_compaction: Mutex::new(Instant::now()),
366-
};
367-
368-
// After opening the DB, we want to compact it.
369-
//
370-
// This just in case the node crashed before to ensure the db stays fast.
371-
db.force_compaction()?;
372-
373-
Ok(db)
366+
})
374367
}
375368

376369
/// Internal api to open a database in primary mode.

0 commit comments

Comments
 (0)