From 36b52490b9ff4b3bdb006ab09e2ac72ecc9ad8a2 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Jul 30 2021 12:58:11 +0000 Subject: update to 1.23 - update to 1.23 - re-apply following patches * 0001-Allow-leveldbjni-build.patch * 0002-Added-a-DB-SuspendCompations-and-DB-ResumeCompaction.patch * 0003-allow-Get-calls-to-avoid-copies-into-std-string.patch * 0004-bloom_test-failure-on-big-endian-archs.patch * 0005-Restore-soname-versioning-with-CMake-build.patch - drop patch already included in 1.23 * 0006-Align-version-soversion-CMake-setup-closer-with-othe.patch - disable LEVELDB_BUILD_TESTS and LEVELDB_BUILD_BENCHMARKS,as the upstream dist tarball does not contain gtest and gmock sources. Signed-off-by: Kefu Chai --- diff --git a/.gitignore b/.gitignore index 539bf92..865d64e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /leveldb-1.20.tar.gz /leveldb-1.21.tar.gz /leveldb-1.22.tar.gz +/leveldb-1.23.tar.gz diff --git a/0002-Added-a-DB-SuspendCompations-and-DB-ResumeCompaction.patch b/0002-Added-a-DB-SuspendCompations-and-DB-ResumeCompaction.patch index 1f0d504..8823708 100644 --- a/0002-Added-a-DB-SuspendCompations-and-DB-ResumeCompaction.patch +++ b/0002-Added-a-DB-SuspendCompations-and-DB-ResumeCompaction.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Added a DB:SuspendCompations() and DB:ResumeCompactions() https://code.google.com/p/leveldb/issues/detail?id=184 diff --git a/db/db_impl.cc b/db/db_impl.cc -index 761ebf6..da4e160 100644 +index 1a4e459..ae7b96d 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc -@@ -136,6 +136,9 @@ DBImpl::DBImpl(const Options& raw_options, const std::string& dbname) +@@ -135,6 +135,9 @@ DBImpl::DBImpl(const Options& raw_options, const std::string& dbname) table_cache_(new TableCache(dbname_, options_, TableCacheSize(options_))), db_lock_(nullptr), shutting_down_(false), @@ -19,8 +19,8 @@ index 761ebf6..da4e160 100644 background_work_finished_signal_(&mutex_), mem_(nullptr), imm_(nullptr), -@@ -1455,6 +1458,39 @@ void DBImpl::GetApproximateSizes(const Range* range, int n, uint64_t* sizes) { - } +@@ -1464,6 +1467,39 @@ void DBImpl::GetApproximateSizes(const Range* range, int n, uint64_t* sizes) { + v->Unref(); } +void DBImpl::SuspendCompactions() { @@ -60,19 +60,19 @@ index 761ebf6..da4e160 100644 // can call if they wish Status DB::Put(const WriteOptions& opt, const Slice& key, const Slice& value) { diff --git a/db/db_impl.h b/db/db_impl.h -index ae87d6e..6213ccd 100644 +index c7b0172..d955c2a 100644 --- a/db/db_impl.h +++ b/db/db_impl.h -@@ -47,6 +47,8 @@ class DBImpl : public DB { - virtual bool GetProperty(const Slice& property, std::string* value); - virtual void GetApproximateSizes(const Range* range, int n, uint64_t* sizes); - virtual void CompactRange(const Slice* begin, const Slice* end); -+ virtual void SuspendCompactions(); -+ virtual void ResumeCompactions(); +@@ -48,6 +48,8 @@ class DBImpl : public DB { + bool GetProperty(const Slice& property, std::string* value) override; + void GetApproximateSizes(const Range* range, int n, uint64_t* sizes) override; + void CompactRange(const Slice* begin, const Slice* end) override; ++ void SuspendCompactions() override; ++ void ResumeCompactions() override; // Extra methods (for testing) that are not in the public DB interface -@@ -169,6 +171,13 @@ class DBImpl : public DB { +@@ -170,6 +172,13 @@ class DBImpl : public DB { // Lock over the persistent DB state. Non-null iff successfully acquired. FileLock* db_lock_; @@ -87,20 +87,20 @@ index ae87d6e..6213ccd 100644 port::Mutex mutex_; std::atomic shutting_down_; diff --git a/db/db_test.cc b/db/db_test.cc -index 78296d5..9a9c613 100644 +index 908b41d..2e65370 100644 --- a/db/db_test.cc +++ b/db/db_test.cc -@@ -2024,6 +2024,8 @@ class ModelDB : public DB { +@@ -2051,6 +2051,8 @@ class ModelDB : public DB { }; explicit ModelDB(const Options& options) : options_(options) {} -+ virtual void SuspendCompactions() {} -+ virtual void ResumeCompactions() {} - ~ModelDB() {} - virtual Status Put(const WriteOptions& o, const Slice& k, const Slice& v) { ++ virtual void SuspendCompactions() override {} ++ virtual void ResumeCompactions() override {} + ~ModelDB() override = default; + Status Put(const WriteOptions& o, const Slice& k, const Slice& v) override { return DB::Put(o, k, v); diff --git a/include/leveldb/db.h b/include/leveldb/db.h -index ea3d9e5..bd039c4 100644 +index a13d147..61c29c0 100644 --- a/include/leveldb/db.h +++ b/include/leveldb/db.h @@ -145,6 +145,12 @@ class LEVELDB_EXPORT DB { diff --git a/0003-allow-Get-calls-to-avoid-copies-into-std-string.patch b/0003-allow-Get-calls-to-avoid-copies-into-std-string.patch index 5cf6f97..498f81e 100644 --- a/0003-allow-Get-calls-to-avoid-copies-into-std-string.patch +++ b/0003-allow-Get-calls-to-avoid-copies-into-std-string.patch @@ -10,10 +10,10 @@ accept a Value*, and to preserve backward compatibility also keep the original version taking a std::string*. diff --git a/db/db_impl.cc b/db/db_impl.cc -index 761ebf6..16af7e2 100644 +index ae7b96d..5c3a05c 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc -@@ -86,6 +86,22 @@ struct DBImpl::CompactionState { +@@ -85,6 +85,22 @@ struct DBImpl::CompactionState { uint64_t total_bytes; }; @@ -36,7 +36,7 @@ index 761ebf6..16af7e2 100644 // Fix user-supplied options to be reasonable template static void ClipToRange(T* ptr, V minvalue, V maxvalue) { -@@ -1099,6 +1115,13 @@ int64_t DBImpl::TEST_MaxNextLevelOverlappingBytes() { +@@ -1117,6 +1133,13 @@ int64_t DBImpl::TEST_MaxNextLevelOverlappingBytes() { Status DBImpl::Get(const ReadOptions& options, const Slice& key, std::string* value) { @@ -51,40 +51,40 @@ index 761ebf6..16af7e2 100644 MutexLock l(&mutex_); SequenceNumber snapshot; diff --git a/db/db_impl.h b/db/db_impl.h -index ae87d6e..ab96bc7 100644 +index d955c2a..3127110 100644 --- a/db/db_impl.h +++ b/db/db_impl.h -@@ -41,6 +41,9 @@ class DBImpl : public DB { - virtual Status Write(const WriteOptions& options, WriteBatch* updates); - virtual Status Get(const ReadOptions& options, const Slice& key, - std::string* value); +@@ -42,6 +42,9 @@ class DBImpl : public DB { + Status Write(const WriteOptions& options, WriteBatch* updates) override; + Status Get(const ReadOptions& options, const Slice& key, + std::string* value) override; + virtual Status Get(const ReadOptions& options, -+ const Slice& key, -+ Value* value); - virtual Iterator* NewIterator(const ReadOptions&); - virtual const Snapshot* GetSnapshot(); - virtual void ReleaseSnapshot(const Snapshot* snapshot); ++ const Slice& key, ++ Value* value); + Iterator* NewIterator(const ReadOptions&) override; + const Snapshot* GetSnapshot() override; + void ReleaseSnapshot(const Snapshot* snapshot) override; diff --git a/db/db_test.cc b/db/db_test.cc -index 78296d5..cc98ea2 100644 +index 2e65370..db778d9 100644 --- a/db/db_test.cc +++ b/db/db_test.cc -@@ -2036,6 +2036,11 @@ class ModelDB : public DB { +@@ -2065,6 +2065,11 @@ class ModelDB : public DB { assert(false); // Not implemented return Status::NotFound(key); } -+ virtual Status Get(const ReadOptions& options, -+ const Slice& key, Value* value) { ++ Status Get(const ReadOptions& options, ++ const Slice& key, Value* value) override { + assert(false); // Not implemented + return Status::NotFound(key); + } - virtual Iterator* NewIterator(const ReadOptions& options) { + Iterator* NewIterator(const ReadOptions& options) override { if (options.snapshot == nullptr) { KVMap* saved = new KVMap; diff --git a/db/memtable.cc b/db/memtable.cc -index c91405c..382e15b 100644 +index f42774d..4689e2d 100644 --- a/db/memtable.cc +++ b/db/memtable.cc -@@ -97,7 +97,7 @@ void MemTable::Add(SequenceNumber s, ValueType type, const Slice& key, +@@ -98,7 +98,7 @@ void MemTable::Add(SequenceNumber s, ValueType type, const Slice& key, table_.Insert(buf); } @@ -107,10 +107,10 @@ index 9d986b1..85c4cce 100644 private: friend class MemTableIterator; diff --git a/db/version_set.cc b/db/version_set.cc -index 96a92cc..6037878 100644 +index 1963353..c83a4d2 100644 --- a/db/version_set.cc +++ b/db/version_set.cc -@@ -257,7 +257,7 @@ struct Saver { +@@ -256,7 +256,7 @@ struct Saver { SaverState state; const Comparator* ucmp; Slice user_key; @@ -119,15 +119,15 @@ index 96a92cc..6037878 100644 }; } // namespace static void SaveValue(void* arg, const Slice& ikey, const Slice& v) { -@@ -324,7 +324,7 @@ void Version::ForEachOverlapping(Slice user_key, Slice internal_key, void* arg, +@@ -322,7 +322,7 @@ void Version::ForEachOverlapping(Slice user_key, Slice internal_key, void* arg, } Status Version::Get(const ReadOptions& options, const LookupKey& k, - std::string* value, GetStats* stats) { + Value* value, GetStats* stats) { - Slice ikey = k.internal_key(); - Slice user_key = k.user_key(); - const Comparator* ucmp = vset_->icmp_.user_comparator(); + stats->seek_file = nullptr; + stats->seek_file_level = -1; + diff --git a/db/version_set.h b/db/version_set.h index 69f3d70..0f0a463 100644 --- a/db/version_set.h @@ -142,7 +142,7 @@ index 69f3d70..0f0a463 100644 // Adds "stats" into the current state. Returns true if a new diff --git a/include/leveldb/db.h b/include/leveldb/db.h -index ea3d9e5..7891b41 100644 +index 61c29c0..1a93feb 100644 --- a/include/leveldb/db.h +++ b/include/leveldb/db.h @@ -40,6 +40,17 @@ struct LEVELDB_EXPORT Range { diff --git a/0004-bloom_test-failure-on-big-endian-archs.patch b/0004-bloom_test-failure-on-big-endian-archs.patch index 49cb4cf..cb679b6 100644 --- a/0004-bloom_test-failure-on-big-endian-archs.patch +++ b/0004-bloom_test-failure-on-big-endian-archs.patch @@ -13,12 +13,12 @@ leveldb. The fix can be to bump up the acceptable false positives. https://groups.google.com/d/topic/leveldb/SbVPvl4j4vU/discussion diff --git a/util/bloom_test.cc b/util/bloom_test.cc -index 436daa9..e4edc45 100644 +index 520473e..e4053e6 100644 --- a/util/bloom_test.cc +++ b/util/bloom_test.cc -@@ -136,7 +136,7 @@ TEST(BloomTest, VaryingLengths) { - fprintf(stderr, "False positives: %5.2f%% @ length = %6d ; bytes = %6d\n", - rate * 100.0, length, static_cast(FilterSize())); +@@ -136,7 +136,7 @@ TEST_F(BloomTest, VaryingLengths) { + "False positives: %5.2f%% @ length = %6d ; bytes = %6d\n", + rate * 100.0, length, static_cast(FilterSize())); } - ASSERT_LE(rate, 0.02); // Must not be over 2% + ASSERT_LE(rate, 0.03); // Must not be over 3% diff --git a/0005-Restore-soname-versioning-with-CMake-build.patch b/0005-Restore-soname-versioning-with-CMake-build.patch index d2994fc..328b48a 100644 --- a/0005-Restore-soname-versioning-with-CMake-build.patch +++ b/0005-Restore-soname-versioning-with-CMake-build.patch @@ -16,10 +16,10 @@ This matches the soname from v1.20. PiperOrigin-RevId: 241334113 diff --git a/CMakeLists.txt b/CMakeLists.txt -index e471a2a..ceb5dd9 100644 +index f8285b8..9de6c3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -233,6 +233,10 @@ if(BUILD_SHARED_LIBS) +@@ -259,6 +259,10 @@ if(BUILD_SHARED_LIBS) # Used by include/export.h. LEVELDB_SHARED_LIBRARY ) diff --git a/0006-Align-version-soversion-CMake-setup-closer-with-othe.patch b/0006-Align-version-soversion-CMake-setup-closer-with-othe.patch deleted file mode 100644 index 77fe096..0000000 --- a/0006-Align-version-soversion-CMake-setup-closer-with-othe.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Victor Costan -Date: Mon, 1 Apr 2019 17:17:47 -0700 -Subject: [PATCH] Align version/soversion CMake setup closer with other - repositories. - -PiperOrigin-RevId: 241432456 - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ceb5dd9..d50f6c2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -213,6 +213,10 @@ target_include_directories(leveldb - $ - $ - ) -+ -+set_target_properties(leveldb -+ PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) -+ - target_compile_definitions(leveldb - PRIVATE - # Used by include/export.h when building shared libraries. -@@ -233,10 +237,6 @@ if(BUILD_SHARED_LIBS) - # Used by include/export.h. - LEVELDB_SHARED_LIBRARY - ) -- set_target_properties(leveldb -- PROPERTIES VERSION ${PROJECT_VERSION}) -- set_target_properties(leveldb -- PROPERTIES SOVERSION 1) - endif(BUILD_SHARED_LIBS) - - if(HAVE_CLANG_THREAD_SAFETY) diff --git a/leveldb.spec b/leveldb.spec index 7dd87a0..c42a96c 100644 --- a/leveldb.spec +++ b/leveldb.spec @@ -1,7 +1,7 @@ %undefine __cmake_in_source_build Name: leveldb -Version: 1.22 -Release: 4%{?dist} +Version: 1.23 +Release: 1%{?dist} Summary: A fast and lightweight key/value database library by Google License: BSD URL: https://github.com/google/leveldb @@ -54,7 +54,8 @@ EOF %build -%cmake +%cmake -DLEVELDB_BUILD_TESTS:BOOL=OFF \ + -DLEVELDB_BUILD_BENCHMARKS:BOOL=OFF %cmake_build @@ -87,6 +88,9 @@ cp -a %{name}.pc %{buildroot}%{_libdir}/pkgconfig/ %changelog +* Fri Jul 30 2021 Kefu Chai - 1.23-1 +- Update to 1.23 + * Thu Jul 22 2021 Fedora Release Engineering - 1.22-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/sources b/sources index c740c02..c05c944 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (leveldb-1.22.tar.gz) = f9bbf5f466e7f707b94e19261762319ea9f65d41911690e84f59098551e2e69beccf756a414d705ade74ee96fd979bdb8b94c171c6f2cc83873cbd4a9380dbab +SHA512 (leveldb-1.23.tar.gz) = ac15eac29387b9f702a901b6567d47a9f8c17cf5c7d8700a77ec771da25158c83b04959c33f3d4de7a3f033ef08f545d14ba823a8d527e21889c4b78065b0f84