Skip to content

Commit

Permalink
Merge pull request #316 from anthonyroussel/bump-rocksdb
Browse files Browse the repository at this point in the history
Bump rocksdb to 0.21
  • Loading branch information
valeriansaliou authored Dec 8, 2023
2 parents e2f5d2c + 81d5f1e commit cc116b4
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 12 deletions.
59 changes: 51 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ serde_derive = "1.0"
rand = "0.8"
unicode-segmentation = "1.6"
radix = "0.6"
rocksdb = { version = "0.17", features = ["zstd"] }
rocksdb = { version = "0.21", features = ["zstd"] }
fst = "0.3"
fst-levenshtein = "0.3"
fst-regex = "0.3"
Expand Down
8 changes: 5 additions & 3 deletions src/store/kv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use rocksdb::backup::{
RestoreOptions as DBRestoreOptions,
};
use rocksdb::{
DBCompactionStyle, DBCompressionType, Error as DBError, FlushOptions, Options as DBOptions,
DBCompactionStyle, DBCompressionType, Env as DBEnv, Error as DBError, FlushOptions, Options as DBOptions,
WriteBatch, WriteOptions, DB,
};
use std::fmt;
Expand Down Expand Up @@ -298,8 +298,9 @@ impl StoreKVPool {
.map_err(|_| io_error!("database open failure"))?;

// Initialize KV database backup engine
let backup_opts = DBBackupEngineOptions::new(&kv_backup_path).unwrap();
let mut kv_backup_engine =
DBBackupEngine::open(&DBBackupEngineOptions::default(), &kv_backup_path)
DBBackupEngine::open(&backup_opts, &DBEnv::new().unwrap())
.map_err(|_| io_error!("backup engine failure"))?;

// Proceed actual KV database backup
Expand Down Expand Up @@ -350,8 +351,9 @@ impl StoreKVPool {
fs::create_dir_all(&kv_path)?;

// Initialize KV database backup engine
let backup_opts = DBBackupEngineOptions::new(&origin_path).unwrap();
let mut kv_backup_engine =
DBBackupEngine::open(&DBBackupEngineOptions::default(), &origin_path)
DBBackupEngine::open(&backup_opts, &DBEnv::new().unwrap())
.map_err(|_| io_error!("backup engine failure"))?;

kv_backup_engine
Expand Down

0 comments on commit cc116b4

Please sign in to comment.