summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Fiekas <niklas.fiekas@backscattering.de>2023-09-21 10:26:52 +0200
committerGitHub <noreply@github.com>2023-09-21 09:26:52 +0100
commit734cf99e732c84702a4e73be5dd4aea99bc268f5 (patch)
treeaae1ec24920d37b5fead3af2cb08bdf13f448c93
parent36ac5ef70d1f27355031aabc4989e80685ff1937 (diff)
Update RocksDB to 8.5.3 (#815)
-rw-r--r--Cargo.toml2
-rw-r--r--librocksdb-sys/Cargo.toml2
-rw-r--r--librocksdb-sys/build_version.cc8
m---------librocksdb-sys/rocksdb0
-rw-r--r--librocksdb-sys/rocksdb_lib_sources.txt2
-rw-r--r--librocksdb-sys/tests/ffi.rs2
-rw-r--r--src/db_options.rs33
-rw-r--r--src/lib.rs5
-rw-r--r--tests/test_db.rs5
9 files changed, 48 insertions, 11 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 7efbd95..0bb8a8b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -36,7 +36,7 @@ serde1 = ["serde"]
[dependencies]
libc = "0.2"
-librocksdb-sys = { path = "librocksdb-sys", version = "0.11.0" }
+librocksdb-sys = { path = "librocksdb-sys", version = "0.12.0" }
serde = { version = "1", features = [ "derive" ], optional = true }
[dev-dependencies]
diff --git a/librocksdb-sys/Cargo.toml b/librocksdb-sys/Cargo.toml
index 5a2bfc9..174103f 100644
--- a/librocksdb-sys/Cargo.toml
+++ b/librocksdb-sys/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "librocksdb-sys"
-version = "0.11.0+8.3.2"
+version = "0.12.0+8.5.3"
edition = "2018"
rust-version = "1.63"
authors = ["Karl Hobley <karlhobley10@gmail.com>", "Arkadiy Paronyan <arkadiy@ethcore.io>"]
diff --git a/librocksdb-sys/build_version.cc b/librocksdb-sys/build_version.cc
index 9277cf4..ffc616f 100644
--- a/librocksdb-sys/build_version.cc
+++ b/librocksdb-sys/build_version.cc
@@ -8,17 +8,17 @@
// The build script may replace these values with real values based
// on whether or not GIT is available and the platform settings
-static const std::string rocksdb_build_git_sha = "3f7c92b9753b697ce6a5ea737086d2751f17956c";
-static const std::string rocksdb_build_git_tag = "rocksdb_build_git_tag:v8.3.2";
+static const std::string rocksdb_build_git_sha = "f32521662acf3352397d438b732144c7813bbbec";
+static const std::string rocksdb_build_git_tag = "rocksdb_build_git_tag:v8.5.3";
#define HAS_GIT_CHANGES 0
#if HAS_GIT_CHANGES == 0
// If HAS_GIT_CHANGES is 0, the GIT date is used.
// Use the time the branch/tag was last modified
-static const std::string rocksdb_build_date = "rocksdb_build_date:2023-06-15 05:32:14";
+static const std::string rocksdb_build_date = "rocksdb_build_date:2023-09-01 20:58:39";
#else
// If HAS_GIT_CHANGES is > 0, the branch/tag has modifications.
// Use the time the build was created.
-static const std::string rocksdb_build_date = "rocksdb_build_date:2023-06-15 05:32:14";
+static const std::string rocksdb_build_date = "rocksdb_build_date:2023-09-01 20:58:39";
#endif
std::unordered_map<std::string, ROCKSDB_NAMESPACE::RegistrarFunc> ROCKSDB_NAMESPACE::ObjectRegistry::builtins_ = {};
diff --git a/librocksdb-sys/rocksdb b/librocksdb-sys/rocksdb
-Subproject 3f7c92b9753b697ce6a5ea737086d2751f17956
+Subproject f32521662acf3352397d438b732144c7813bbbe
diff --git a/librocksdb-sys/rocksdb_lib_sources.txt b/librocksdb-sys/rocksdb_lib_sources.txt
index caa9031..6bac45e 100644
--- a/librocksdb-sys/rocksdb_lib_sources.txt
+++ b/librocksdb-sys/rocksdb_lib_sources.txt
@@ -243,6 +243,8 @@ util/stderr_logger.cc
util/string_util.cc
util/thread_local.cc
util/threadpool_imp.cc
+util/udt_util.cc
+util/write_batch_util.cc
util/xxhash.cc
utilities/agg_merge/agg_merge.cc
utilities/backup/backup_engine.cc
diff --git a/librocksdb-sys/tests/ffi.rs b/librocksdb-sys/tests/ffi.rs
index a20c0a5..df8c595 100644
--- a/librocksdb-sys/tests/ffi.rs
+++ b/librocksdb-sys/tests/ffi.rs
@@ -1072,7 +1072,7 @@ fn ffi() {
rocksdb_slicetransform_create_fixed_prefix(3),
);
rocksdb_options_set_hash_skip_list_rep(options, 5000, 4, 4);
- rocksdb_options_set_plain_table_factory(options, 4, 10, 0.75, 16);
+ rocksdb_options_set_plain_table_factory(options, 4, 10, 0.75, 16, 0, 0, 0, 0);
rocksdb_options_set_allow_concurrent_memtable_write(options, 0);
db = rocksdb_open(options, dbname, &mut err);
diff --git a/src/db_options.rs b/src/db_options.rs
index 28efbec..b9a0edb 100644
--- a/src/db_options.rs
+++ b/src/db_options.rs
@@ -2426,7 +2426,7 @@ impl Options {
/// # Examples
///
/// ```
- /// use rocksdb::{Options, PlainTableFactoryOptions};
+ /// use rocksdb::{KeyEncodingType, Options, PlainTableFactoryOptions};
///
/// let mut opts = Options::default();
/// let factory_opts = PlainTableFactoryOptions {
@@ -2434,6 +2434,10 @@ impl Options {
/// bloom_bits_per_key: 20,
/// hash_table_ratio: 0.75,
/// index_sparseness: 16,
+ /// huge_page_tlb_size: 0,
+ /// encoding_type: KeyEncodingType::Plain,
+ /// full_scan_mode: false,
+ /// store_index_in_file: false,
/// };
///
/// opts.set_plain_table_factory(&factory_opts);
@@ -2446,6 +2450,10 @@ impl Options {
options.bloom_bits_per_key,
options.hash_table_ratio,
options.index_sparseness,
+ options.huge_page_tlb_size,
+ options.encoding_type as c_char,
+ c_uchar::from(options.full_scan_mode),
+ c_uchar::from(options.store_index_in_file),
);
}
}
@@ -3596,6 +3604,21 @@ pub enum ChecksumType {
XXH3 = 4, // Supported since RocksDB 6.27
}
+/// Used in [`PlainTableFactoryOptions`].
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub enum KeyEncodingType {
+ /// Always write full keys.
+ Plain = 0,
+ /// Find opportunities to write the same prefix for multiple rows.
+ Prefix = 1,
+}
+
+impl Default for KeyEncodingType {
+ fn default() -> Self {
+ KeyEncodingType::Plain
+ }
+}
+
/// Used with DBOptions::set_plain_table_factory.
/// See official [wiki](https://github.com/facebook/rocksdb/wiki/PlainTable-Format) for more
/// information.
@@ -3605,11 +3628,19 @@ pub enum ChecksumType {
/// bloom_bits_per_key: 10
/// hash_table_ratio: 0.75
/// index_sparseness: 16
+/// huge_page_tlb_size: 0
+/// encoding_type: KeyEncodingType::Plain
+/// full_scan_mode: false
+/// store_index_in_file: false
pub struct PlainTableFactoryOptions {
pub user_key_length: u32,
pub bloom_bits_per_key: i32,
pub hash_table_ratio: f64,
pub index_sparseness: usize,
+ pub huge_page_tlb_size: usize,
+ pub encoding_type: KeyEncodingType,
+ pub full_scan_mode: bool,
+ pub store_index_in_file: bool,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
diff --git a/src/lib.rs b/src/lib.rs
index 2e4f17f..02daf6d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -115,8 +115,9 @@ pub use crate::{
BlockBasedIndexType, BlockBasedOptions, BottommostLevelCompaction, Cache, ChecksumType,
CompactOptions, CuckooTableOptions, DBCompactionStyle, DBCompressionType, DBPath,
DBRecoveryMode, DataBlockIndexType, FifoCompactOptions, FlushOptions,
- IngestExternalFileOptions, LogLevel, MemtableFactory, Options, PlainTableFactoryOptions,
- ReadOptions, UniversalCompactOptions, UniversalCompactionStopStyle, WriteOptions,
+ IngestExternalFileOptions, KeyEncodingType, LogLevel, MemtableFactory, Options,
+ PlainTableFactoryOptions, ReadOptions, UniversalCompactOptions,
+ UniversalCompactionStopStyle, WriteOptions,
},
db_pinnable_slice::DBPinnableSlice,
env::Env,
diff --git a/tests/test_db.rs b/tests/test_db.rs
index 1f073f2..4b14703 100644
--- a/tests/test_db.rs
+++ b/tests/test_db.rs
@@ -750,6 +750,7 @@ fn fifo_compaction_test() {
let mut opts = Options::default();
opts.create_if_missing(true);
opts.create_missing_column_families(true);
+ opts.set_level_compaction_dynamic_level_bytes(false);
// set compaction style
{
@@ -783,7 +784,7 @@ fn fifo_compaction_test() {
let livefiles = db.live_files().unwrap();
assert_eq!(livefiles.len(), 1);
livefiles.iter().for_each(|f| {
- assert_eq!(f.level, 1);
+ assert_eq!(f.level, 6);
assert_eq!(f.column_family_name, "cf1");
assert!(!f.name.is_empty());
assert_eq!(f.start_key.as_ref().unwrap().as_slice(), "k1".as_bytes());
@@ -875,6 +876,7 @@ fn get_with_cache_and_bulkload_test() {
opts.set_db_log_dir(&log_path);
opts.set_memtable_whole_key_filtering(true);
opts.set_dump_malloc_stats(true);
+ opts.set_level_compaction_dynamic_level_bytes(false);
// trigger all sst files in L1/2 instead of L0
opts.set_max_bytes_for_level_base(64 << 10); // 64KB
@@ -1010,6 +1012,7 @@ fn get_with_cache_and_bulkload_and_blobs_test() {
opts.set_dump_malloc_stats(true);
opts.set_enable_blob_files(true);
opts.set_min_blob_size(256); // set small to ensure it is actually used
+ opts.set_level_compaction_dynamic_level_bytes(false);
// trigger all sst files in L1/2 instead of L0
opts.set_max_bytes_for_level_base(64 << 10); // 64KB