Skip to content

Commit

Permalink
Bump rocksdb to 0.21
Browse files Browse the repository at this point in the history
Fixes #315

Build of sonic-server is failing on NixOS
for a few weeks now, see https://hydra.nixos.org/build/239524816

This failing build has been caused by a clang 16 upgrade,
because rocksdb depends on a old rust-bindgen version which
is not compatible with this version of clang.

See rust-lang/rust-bindgen#2312

A resolution is to upgrade rocksdb to its latest version.
  • Loading branch information
anthonyroussel committed Nov 26, 2023
1 parent e2f5d2c commit 81d5f1e
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 81d5f1e

Please sign in to comment.