From 01f353df677c390cd617bd32330da96f7f1902ce Mon Sep 17 00:00:00 2001 From: hulk Date: Thu, 8 Aug 2024 00:10:51 +0800 Subject: [PATCH] chore(storage): Remove speedb due to lack of active (#2476) --- .github/workflows/kvrocks.yaml | 6 +--- CMakeLists.txt | 13 ++----- NOTICE | 1 - cmake/modules/FindJeMalloc.cmake | 1 - cmake/modules/FindZLIB.cmake | 1 - cmake/modules/Findlz4.cmake | 1 - cmake/modules/Findzstd.cmake | 1 - cmake/speedb.cmake | 60 -------------------------------- src/storage/storage.h | 1 - tests/cppunit/compact_test.cc | 1 - 10 files changed, 3 insertions(+), 83 deletions(-) delete mode 100644 cmake/speedb.cmake diff --git a/.github/workflows/kvrocks.yaml b/.github/workflows/kvrocks.yaml index cb0835010c7..f5f53c0e483 100644 --- a/.github/workflows/kvrocks.yaml +++ b/.github/workflows/kvrocks.yaml @@ -200,10 +200,6 @@ jobs: os: ubuntu-22.04 compiler: clang new_encoding: -DENABLE_NEW_ENCODING=FALSE - - name: Ubuntu GCC with speedb enabled - os: ubuntu-22.04 - compiler: gcc - with_speedb: -DENABLE_SPEEDB=ON runs-on: ${{ matrix.os }} env: @@ -269,7 +265,7 @@ jobs: run: | ./x.py build -j$NPROC --unittest --compiler ${{ matrix.compiler }} ${{ matrix.without_jemalloc }} \ ${{ matrix.without_luajit }} ${{ matrix.with_ninja }} ${{ matrix.with_sanitizer }} ${{ matrix.with_openssl }} \ - ${{ matrix.new_encoding }} ${{ matrix.with_speedb }} ${{ env.CMAKE_EXTRA_DEFS }} + ${{ matrix.new_encoding }} ${{ env.CMAKE_EXTRA_DEFS }} - name: Build Kvrocks (SonarCloud) if: ${{ matrix.sonarcloud }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 3542cf6fc27..78d0581da94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,6 @@ option(ENABLE_STATIC_LIBSTDCXX "link kvrocks with static library of libstd++ ins option(ENABLE_LUAJIT "enable use of luaJIT instead of lua" ON) option(ENABLE_OPENSSL "enable openssl to support tls connection" OFF) option(ENABLE_IPO "enable interprocedural optimization" ON) -option(ENABLE_SPEEDB "enable speedb instead of rocksdb" OFF) set(SYMBOLIZE_BACKEND "" CACHE STRING "symbolization backend library for cpptrace (libbacktrace, libdwarf, or empty)") set(PORTABLE 0 CACHE STRING "build a portable binary (disable arch-specific optimizations)") # TODO: set ENABLE_NEW_ENCODING to ON when we are ready @@ -156,11 +155,7 @@ include(cmake/lz4.cmake) include(cmake/zlib.cmake) include(cmake/zstd.cmake) include(cmake/tbb.cmake) -if(ENABLE_SPEEDB) - include(cmake/speedb.cmake) -else() - include(cmake/rocksdb.cmake) -endif() +include(cmake/rocksdb.cmake) include(cmake/libevent.cmake) include(cmake/fmt.cmake) include(cmake/jsoncons.cmake) @@ -261,11 +256,7 @@ elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQU endif() target_link_libraries(kvrocks_objs PUBLIC -fno-omit-frame-pointer) target_link_libraries(kvrocks_objs PUBLIC ${EXTERNAL_LIBS}) -if (ENABLE_SPEEDB) - target_compile_definitions(kvrocks_objs PUBLIC KVROCKS_STORAGE_ENGINE=Speedb) -else() - target_compile_definitions(kvrocks_objs PUBLIC KVROCKS_STORAGE_ENGINE=RocksDB) -endif() +target_compile_definitions(kvrocks_objs PUBLIC KVROCKS_STORAGE_ENGINE=RocksDB) if(ENABLE_OPENSSL) target_compile_definitions(kvrocks_objs PUBLIC ENABLE_OPENSSL) endif() diff --git a/NOTICE b/NOTICE index 3b2a470bf3c..abffad2bd58 100644 --- a/NOTICE +++ b/NOTICE @@ -28,7 +28,6 @@ NB: RocksDB is dual-licensed under both the GPLv2 and Apache 2.0 License. This product uses it under the Apache 2.0 License. * oneTBB(https://github.com/oneapi-src/oneTBB) -* speedb(https://github.com/speedb-io/speedb, alternative to rocksdb) Files src/common/rocksdb_crc32c.h and src/storage/batch_debugger.h are modified from RocksDB. Files src/types/bloom_filter.* are modified from Apache Arrow. diff --git a/cmake/modules/FindJeMalloc.cmake b/cmake/modules/FindJeMalloc.cmake index 4c9cd807483..23aa812e132 100644 --- a/cmake/modules/FindJeMalloc.cmake +++ b/cmake/modules/FindJeMalloc.cmake @@ -22,5 +22,4 @@ if(jemalloc_SOURCE_DIR) add_library(JeMalloc::JeMalloc ALIAS jemalloc) # rocksdb use it install(TARGETS jemalloc EXPORT RocksDBTargets) # export for install(...) - install(TARGETS jemalloc EXPORT SpeedbTargets) # export for install(...) endif() diff --git a/cmake/modules/FindZLIB.cmake b/cmake/modules/FindZLIB.cmake index 930267f3743..1fa8982fa75 100644 --- a/cmake/modules/FindZLIB.cmake +++ b/cmake/modules/FindZLIB.cmake @@ -25,5 +25,4 @@ if(zlib_SOURCE_DIR) target_link_libraries(zlib_with_headers INTERFACE zlibstatic) add_library(ZLIB::ZLIB ALIAS zlib_with_headers) install(TARGETS zlibstatic zlib_with_headers EXPORT RocksDBTargets) # export for install(...) - install(TARGETS zlibstatic zlib_with_headers EXPORT SpeedbTargets) # export for install(...) endif() diff --git a/cmake/modules/Findlz4.cmake b/cmake/modules/Findlz4.cmake index 6b152bac258..16969e4cfb7 100644 --- a/cmake/modules/Findlz4.cmake +++ b/cmake/modules/Findlz4.cmake @@ -22,5 +22,4 @@ if(lz4_SOURCE_DIR) add_library(lz4::lz4 ALIAS lz4) # rocksdb use it install(TARGETS lz4 EXPORT RocksDBTargets) # export for install(...) - install(TARGETS lz4 EXPORT SpeedbTargets) # export for install(...) endif() diff --git a/cmake/modules/Findzstd.cmake b/cmake/modules/Findzstd.cmake index 10e9893196f..1f1dbe11c6b 100644 --- a/cmake/modules/Findzstd.cmake +++ b/cmake/modules/Findzstd.cmake @@ -22,5 +22,4 @@ if(zstd_SOURCE_DIR) add_library(zstd::zstd ALIAS zstd) # rocksdb use it install(TARGETS zstd EXPORT RocksDBTargets) # export for install(...) - install(TARGETS zstd EXPORT SpeedbTargets) # export for install(...) endif() diff --git a/cmake/speedb.cmake b/cmake/speedb.cmake deleted file mode 100644 index a0bc350ece4..00000000000 --- a/cmake/speedb.cmake +++ /dev/null @@ -1,60 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -include_guard() - -set(COMPILE_WITH_JEMALLOC ON) - -if (DISABLE_JEMALLOC) - set(COMPILE_WITH_JEMALLOC OFF) -endif() - -include(cmake/utils.cmake) - -FetchContent_DeclareGitHubWithMirror(speedb - speedb-io/speedb speedb/v2.8.0 - MD5=3da818408057c8c818bfc9adc40d929f -) - -FetchContent_GetProperties(jemalloc) -FetchContent_GetProperties(snappy) -FetchContent_GetProperties(tbb) - -FetchContent_MakeAvailableWithArgs(speedb - CMAKE_MODULE_PATH=${PROJECT_SOURCE_DIR}/cmake/modules # to locate FindJeMalloc.cmake - Snappy_DIR=${PROJECT_SOURCE_DIR}/cmake/modules # to locate SnappyConfig.cmake - FAIL_ON_WARNINGS=OFF - WITH_TESTS=OFF - WITH_BENCHMARK_TOOLS=OFF - WITH_CORE_TOOLS=OFF - WITH_TOOLS=OFF - WITH_SNAPPY=ON - WITH_LZ4=ON - WITH_ZLIB=ON - WITH_ZSTD=ON - WITH_TOOLS=OFF - WITH_GFLAGS=OFF - WITH_TBB=ON - USE_RTTI=ON - ROCKSDB_BUILD_SHARED=OFF - WITH_JEMALLOC=${COMPILE_WITH_JEMALLOC} - PORTABLE=${PORTABLE} -) - -add_library(rocksdb_with_headers INTERFACE) -target_include_directories(rocksdb_with_headers INTERFACE ${speedb_SOURCE_DIR}/include) -target_link_libraries(rocksdb_with_headers INTERFACE speedb) diff --git a/src/storage/storage.h b/src/storage/storage.h index aa93fa27d4a..df992848098 100644 --- a/src/storage/storage.h +++ b/src/storage/storage.h @@ -48,7 +48,6 @@ enum class StorageEngineType : uint16_t { RocksDB, - Speedb, }; inline constexpr StorageEngineType STORAGE_ENGINE_TYPE = StorageEngineType::KVROCKS_STORAGE_ENGINE; diff --git a/tests/cppunit/compact_test.cc b/tests/cppunit/compact_test.cc index fad4cb13894..0717fbabb61 100644 --- a/tests/cppunit/compact_test.cc +++ b/tests/cppunit/compact_test.cc @@ -51,7 +51,6 @@ TEST(Compact, Filter) { auto status = storage->Compact(nullptr, nullptr, nullptr); assert(status.ok()); // Compact twice to workaround issue fixed by: https://github.com/facebook/rocksdb/pull/11468 - // before rocksdb/speedb 8.1.1. This line can be removed after speedb upgraded above 8.1.1. status = storage->Compact(nullptr, nullptr, nullptr); assert(status.ok());