-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(estimator): compact RocksDB in testbed setup #7502
feat(estimator): compact RocksDB in testbed setup #7502
Conversation
Run compaction on the DB after inserting all records from the state dump. This brings the layout of SST files to a more stable and optimal layout. See near#4771 for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
But let's document the knowledge of "why" we are running compaction, and what breaks if we don't. Most obvious way is on the store.compact()
call, but, if we have some better overview of the whole process somewhere (readme? top comment in lib.rs), that would be even a better place.
@@ -247,6 +247,14 @@ impl Database for RocksDB { | |||
self.db.write(batch).map_err(into_other) | |||
} | |||
|
|||
fn compact(&self) -> io::Result<()> { | |||
let none = Option::<&[u8]>::None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And that's why I have a distace for AsRef-polymorphism for nicer APIs :)
- short comment why `compact()` is called - document the issue in `runtime/runtime-params-estimator/src/lib.rs` - remove default implementation of `Database::copmact`
I added some documentation in |
/// Compact database representation. | ||
/// | ||
/// If the database supports it a form of compaction, calling this function | ||
/// is blocking until compaction finishes. Otherwise, this is a no-op. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Compact database representation. | |
/// | |
/// If the database supports it a form of compaction, calling this function | |
/// is blocking until compaction finishes. Otherwise, this is a no-op. | |
/// Compacts database representation. | |
/// | |
/// If the database supports compaction, calling this function blocks | |
/// until compaction finishes. Otherwise, this is a no-op. |
Run compaction on the DB after inserting all records from the state dump. This brings the layout of SST files to a more stable and optimal layout. See #4771 for more details. This is an estimator only change.
Run compaction on the DB after inserting all records from the state
dump. This brings the layout of SST files to a more stable and optimal
layout. See #4771 for more details.
This is an estimator only change.