Skip to content
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

Support RocksDB 7.x BackupEngineOptions #700

Conversation

exabytes18
Copy link
Contributor

The main objective of this PR is to support rocksdb_backup_engine_options_t (introduced in facebook/rocksdb@78aee6f) so that we can call the associated rocksdb_backup_engine_options_set_max_background_operations function and achieve higher parallelism for backup and restore operations (notably, the current parallelism is 1, meaning that rocksdb will only copy/checksum/hardlink/whatever 1 file at a time, which is insufficient for rocksdb to full utilize hardware on even modest machines).

One side-effect of this PR is that the signature for BackupEngine::open changes from open<P: AsRef<Path>>(opts: &BackupEngineOptions, path: P) to open(opts: &BackupEngineOptions, env: &Env). This may cause some consumer code to fail to compile, but it aligns better with the RocksDB-proper BackupEngine::Open() signature, so I believe it's a worthwhile change.

Finally, I'm not well-versed in ffi or the related patterns (like _outlive), so please carefully review those bits in the PR.

Thanks!
Matt

@exabytes18
Copy link
Contributor Author

@aleksuss, @stanislav-tkach, could you help to review this PR?

@aleksuss aleksuss requested review from stanislav-tkach and aleksuss and removed request for stanislav-tkach November 16, 2022 15:02
@exabytes18 exabytes18 force-pushed the support-rocksdb-7.x-backup-engine-options branch from cde4d66 to 5efce4b Compare December 5, 2022 18:19
@exabytes18
Copy link
Contributor Author

@aleksuss, I've fixed a clippy warning. Could you approve the workflow run again?

BusyJay pushed a commit to BusyJay/rust-rocksdb that referenced this pull request Dec 10, 2022
Signed-off-by: Wenbo Zhang <ethercflow@gmail.com>
@exabytes18 exabytes18 force-pushed the support-rocksdb-7.x-backup-engine-options branch from 5efce4b to 1827aea Compare December 20, 2022 07:45
@exabytes18
Copy link
Contributor Author

@aleksuss, could you take a look at the PR when you next have a chance?

@exabytes18 exabytes18 force-pushed the support-rocksdb-7.x-backup-engine-options branch from 1827aea to 5fee0c0 Compare January 18, 2023 06:40
@exabytes18
Copy link
Contributor Author

@aleksuss, @stanislav-tkach, could you help to merge this?

@exabytes18 exabytes18 force-pushed the support-rocksdb-7.x-backup-engine-options branch from 5fee0c0 to afff50d Compare January 19, 2023 18:28
@@ -217,27 +224,40 @@ impl BackupEngine {
}

impl BackupEngineOptions {
//
}
pub fn new<P: AsRef<Path>>(backup_dir: P) -> Result<Self, Error> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add some description to the public methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Please have another look.

@exabytes18 exabytes18 force-pushed the support-rocksdb-7.x-backup-engine-options branch from 526105d to 72ce11d Compare January 27, 2023 21:48
src/env.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants