From 3d32011909367612ae59761bd786fe7e5ee14c46 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Fri, 22 Jan 2021 12:55:24 +0200 Subject: [PATCH] Bump rocksdb up to 6.15.4 (#493) --- Cargo.toml | 2 +- librocksdb-sys/Cargo.toml | 2 +- librocksdb-sys/build.rs | 42 ++++++++++++++++---------- librocksdb-sys/build_version.cc | 4 +-- librocksdb-sys/rocksdb | 2 +- librocksdb-sys/rocksdb_lib_sources.txt | 15 +++++++-- tests/test_column_family.rs | 5 +-- tests/test_iterator.rs | 2 +- 8 files changed, 46 insertions(+), 28 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9531f14..06a5b9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ bzip2 = ["librocksdb-sys/bzip2"] [dependencies] libc = "0.2" -librocksdb-sys = { path = "librocksdb-sys", version = "6.11.4" } +librocksdb-sys = { path = "librocksdb-sys", version = "6.15.4" } [dev-dependencies] trybuild = "1.0.21" diff --git a/librocksdb-sys/Cargo.toml b/librocksdb-sys/Cargo.toml index 7d2f6ad..e16a842 100644 --- a/librocksdb-sys/Cargo.toml +++ b/librocksdb-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librocksdb-sys" -version = "6.11.4" +version = "6.15.4" edition = "2018" authors = ["Karl Hobley ", "Arkadiy Paronyan "] license = "MIT/Apache-2.0/BSD-3-Clause" diff --git a/librocksdb-sys/build.rs b/librocksdb-sys/build.rs index 6bee3b7..852c5ef 100644 --- a/librocksdb-sys/build.rs +++ b/librocksdb-sys/build.rs @@ -115,32 +115,36 @@ fn build_rocksdb() { } if target.contains("darwin") { - config.define("OS_MACOSX", Some("1")); - config.define("ROCKSDB_PLATFORM_POSIX", Some("1")); - config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); + config.define("OS_MACOSX", None); + config.define("ROCKSDB_PLATFORM_POSIX", None); + config.define("ROCKSDB_LIB_IO_POSIX", None); } else if target.contains("android") { - config.define("OS_ANDROID", Some("1")); - config.define("ROCKSDB_PLATFORM_POSIX", Some("1")); - config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); + config.define("OS_ANDROID", None); + config.define("ROCKSDB_PLATFORM_POSIX", None); + config.define("ROCKSDB_LIB_IO_POSIX", None); } else if target.contains("linux") { - config.define("OS_LINUX", Some("1")); - config.define("ROCKSDB_PLATFORM_POSIX", Some("1")); - config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); + config.define("OS_LINUX", None); + config.define("ROCKSDB_PLATFORM_POSIX", None); + config.define("ROCKSDB_LIB_IO_POSIX", None); } else if target.contains("freebsd") { - config.define("OS_FREEBSD", Some("1")); - config.define("ROCKSDB_PLATFORM_POSIX", Some("1")); - config.define("ROCKSDB_LIB_IO_POSIX", Some("1")); + config.define("OS_FREEBSD", None); + config.define("ROCKSDB_PLATFORM_POSIX", None); + config.define("ROCKSDB_LIB_IO_POSIX", None); } else if target.contains("windows") { link("rpcrt4", false); link("shlwapi", false); - config.define("OS_WIN", Some("1")); - config.define("ROCKSDB_WINDOWS_UTF8_FILENAMES", Some("1")); + config.define("DWIN32", None); + config.define("OS_WIN", None); + config.define("_MBCS", None); + config.define("WIN64", None); + config.define("NOMINMAX", None); + if &target == "x86_64-pc-windows-gnu" { // Tell MinGW to create localtime_r wrapper of localtime_s function. - config.define("_POSIX_C_SOURCE", None); + config.define("_POSIX_C_SOURCE", Some("1")); // Tell MinGW to use at least Windows Vista headers instead of the ones of Windows XP. // (This is minimum supported version of rocksdb) - config.define("_WIN32_WINNT", Some("0x0600")); + config.define("_WIN32_WINNT", Some("_WIN32_WINNT_VISTA")); } // Remove POSIX-specific sources @@ -306,6 +310,12 @@ fn build_bzip2() { } fn try_to_find_and_link_lib(lib_name: &str) -> bool { + if let Ok(v) = env::var(&format!("{}_COMPILE", lib_name)) { + if v.to_lowercase() == "true" || v == "1" { + return false; + } + } + if let Ok(lib_dir) = env::var(&format!("{}_LIB_DIR", lib_name)) { println!("cargo:rustc-link-search=native={}", lib_dir); let mode = match env::var_os(&format!("{}_STATIC", lib_name)) { diff --git a/librocksdb-sys/build_version.cc b/librocksdb-sys/build_version.cc index 03e7541..c8c3820 100644 --- a/librocksdb-sys/build_version.cc +++ b/librocksdb-sys/build_version.cc @@ -1,4 +1,4 @@ #include "build_version.h" -const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:@48bfca38f6f175435052a59791922a1a453d9609@"; -const char* rocksdb_build_git_date = "rocksdb_build_git_date:@2020/07/15 17:54:15@"; +const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:@fbed72f03c3d9e4fdca3e5993587ef2559ba6ab9@"; +const char* rocksdb_build_git_date = "rocksdb_build_git_date:@2021/01/21 12:41:08@"; const char* rocksdb_build_compile_date = __DATE__; diff --git a/librocksdb-sys/rocksdb b/librocksdb-sys/rocksdb index 50f206a..fbed72f 160000 --- a/librocksdb-sys/rocksdb +++ b/librocksdb-sys/rocksdb @@ -1 +1 @@ -Subproject commit 50f206ad84fa6cd516bad1bea93c03ae0655b314 +Subproject commit fbed72f03c3d9e4fdca3e5993587ef2559ba6ab9 diff --git a/librocksdb-sys/rocksdb_lib_sources.txt b/librocksdb-sys/rocksdb_lib_sources.txt index 716b03d..455b214 100644 --- a/librocksdb-sys/rocksdb_lib_sources.txt +++ b/librocksdb-sys/rocksdb_lib_sources.txt @@ -4,10 +4,13 @@ cache/lru_cache.cc cache/sharded_cache.cc db/arena_wrapped_db_iter.cc db/blob/blob_file_addition.cc +db/blob/blob_file_builder.cc +db/blob/blob_file_cache.cc db/blob/blob_file_garbage.cc db/blob/blob_file_meta.cc +db/blob/blob_file_reader.cc db/blob/blob_log_format.cc -db/blob/blob_log_reader.cc +db/blob/blob_log_sequential_reader.cc db/blob/blob_log_writer.cc db/builder.cc db/c.cc @@ -53,6 +56,8 @@ db/memtable.cc db/memtable_list.cc db/merge_helper.cc db/merge_operator.cc +db/output_validator.cc +db/periodic_work_scheduler.cc db/range_del_aggregator.cc db/range_tombstone_fragmenter.cc db/repair.cc @@ -65,6 +70,7 @@ db/version_builder.cc db/version_edit.cc db/version_edit_handler.cc db/version_set.cc +db/wal_edit.cc db/wal_manager.cc db/write_batch.cc db/write_batch_base.cc @@ -118,6 +124,8 @@ monitoring/thread_status_updater_debug.cc monitoring/thread_status_util.cc monitoring/thread_status_util_debug.cc options/cf_options.cc +options/configurable.cc +options/customizable.cc options/db_options.cc options/options.cc options/options_helper.cc @@ -169,6 +177,7 @@ table/plain/plain_table_reader.cc table/sst_file_dumper.cc table/sst_file_reader.cc table/sst_file_writer.cc +table/table_factory.cc table/table_properties.cc table/two_level_iterator.cc test_util/sync_point.cc @@ -235,6 +244,9 @@ utilities/simulator_cache/cache_simulator.cc utilities/simulator_cache/sim_cache.cc utilities/table_properties_collectors/compact_on_deletion_collector.cc utilities/trace/file_trace_reader_writer.cc +utilities/transactions/lock/lock_manager.cc +utilities/transactions/lock/point/point_lock_tracker.cc +utilities/transactions/lock/point/point_lock_manager.cc utilities/transactions/optimistic_transaction.cc utilities/transactions/optimistic_transaction_db_impl.cc utilities/transactions/pessimistic_transaction.cc @@ -242,7 +254,6 @@ utilities/transactions/pessimistic_transaction_db.cc utilities/transactions/snapshot_checker.cc utilities/transactions/transaction_base.cc utilities/transactions/transaction_db_mutex_impl.cc -utilities/transactions/transaction_lock_mgr.cc utilities/transactions/transaction_util.cc utilities/transactions/write_prepared_txn.cc utilities/transactions/write_prepared_txn_db.cc diff --git a/tests/test_column_family.rs b/tests/test_column_family.rs index 95bb138..40db910 100644 --- a/tests/test_column_family.rs +++ b/tests/test_column_family.rs @@ -48,10 +48,7 @@ fn test_column_family() { specifying column families" ), - Err(e) => assert!(e.to_string().starts_with( - "Invalid argument: You have to open all \ - column families." - )), + Err(e) => assert!(e.to_string().starts_with("Invalid argument")), } } diff --git a/tests/test_iterator.rs b/tests/test_iterator.rs index 60d5b77..66215a2 100644 --- a/tests/test_iterator.rs +++ b/tests/test_iterator.rs @@ -300,7 +300,7 @@ fn test_full_iterator() { } } -fn custom_iter<'a>(db: &'a DB) -> impl Iterator + 'a { +fn custom_iter(db: &'_ DB) -> impl Iterator + '_ { db.iterator(IteratorMode::Start) .map(|(_, db_value)| db_value.len()) }