Skip to content

Commit 81d5f1e

Browse files
Bump rocksdb to 0.21
Fixes valeriansaliou#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.
1 parent e2f5d2c commit 81d5f1e

File tree

3 files changed

+57
-12
lines changed

3 files changed

+57
-12
lines changed

Cargo.lock

+51-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ serde_derive = "1.0"
2626
rand = "0.8"
2727
unicode-segmentation = "1.6"
2828
radix = "0.6"
29-
rocksdb = { version = "0.17", features = ["zstd"] }
29+
rocksdb = { version = "0.21", features = ["zstd"] }
3030
fst = "0.3"
3131
fst-levenshtein = "0.3"
3232
fst-regex = "0.3"

src/store/kv.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rocksdb::backup::{
1212
RestoreOptions as DBRestoreOptions,
1313
};
1414
use rocksdb::{
15-
DBCompactionStyle, DBCompressionType, Error as DBError, FlushOptions, Options as DBOptions,
15+
DBCompactionStyle, DBCompressionType, Env as DBEnv, Error as DBError, FlushOptions, Options as DBOptions,
1616
WriteBatch, WriteOptions, DB,
1717
};
1818
use std::fmt;
@@ -298,8 +298,9 @@ impl StoreKVPool {
298298
.map_err(|_| io_error!("database open failure"))?;
299299

300300
// Initialize KV database backup engine
301+
let backup_opts = DBBackupEngineOptions::new(&kv_backup_path).unwrap();
301302
let mut kv_backup_engine =
302-
DBBackupEngine::open(&DBBackupEngineOptions::default(), &kv_backup_path)
303+
DBBackupEngine::open(&backup_opts, &DBEnv::new().unwrap())
303304
.map_err(|_| io_error!("backup engine failure"))?;
304305

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

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

357359
kv_backup_engine

0 commit comments

Comments
 (0)