Skip to content

Commit 4720ba4

Browse files
siyingfacebook-github-bot
authored andcommitted
Remove RocksDB LITE (facebook#11147)
Summary: We haven't been actively mantaining RocksDB LITE recently and the size must have been gone up significantly. We are removing the support. Most of changes were done through following comments: unifdef -m -UROCKSDB_LITE `git grep -l ROCKSDB_LITE | egrep '[.](cc|h)'` by Peter Dillinger. Others changes were manually applied to build scripts, CircleCI manifests, ROCKSDB_LITE is used in an expression and file db_stress_test_base.cc. Pull Request resolved: facebook#11147 Test Plan: See CI Reviewed By: pdillinger Differential Revision: D42796341 fbshipit-source-id: 4920e15fc2060c2cd2221330a6d0e5e65d4b7fe2
1 parent 6943ff6 commit 4720ba4

File tree

478 files changed

+36
-3608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

478 files changed

+36
-3608
lines changed

.circleci/config.yml

-23
Original file line numberDiff line numberDiff line change
@@ -302,27 +302,6 @@ jobs:
302302
- run: USE_RTTI=1 DEBUG_LEVEL=0 make V=1 -j16 static_lib tools db_bench
303303
- run: if ./db_stress --version; then false; else true; fi # ensure without gflags
304304

305-
build-linux-lite:
306-
executor: linux-docker
307-
resource_class: large
308-
steps:
309-
- pre-steps
310-
- run: LITE=1 make V=1 J=8 -j8 check
311-
- post-steps
312-
313-
build-linux-lite-release:
314-
executor: linux-docker
315-
resource_class: large
316-
steps:
317-
- checkout # check out the code in the project directory
318-
- run: LITE=1 make V=1 -j8 release
319-
- run: ./db_stress --version # ensure with gflags
320-
- run: make clean
321-
- run: apt-get remove -y libgflags-dev
322-
- run: LITE=1 make V=1 -j8 release
323-
- run: if ./db_stress --version; then false; else true; fi # ensure without gflags
324-
- post-steps
325-
326305
build-linux-clang-no_test_run:
327306
executor: linux-docker
328307
resource_class: xlarge
@@ -821,7 +800,6 @@ workflows:
821800
- build-linux-cmake-with-folly-coroutines
822801
- build-linux-cmake-with-benchmark
823802
- build-linux-encrypted_env-no_compression
824-
- build-linux-lite
825803
jobs-linux-run-tests-san:
826804
jobs:
827805
- build-linux-clang10-asan
@@ -832,7 +810,6 @@ workflows:
832810
jobs:
833811
- build-linux-release
834812
- build-linux-release-rtti
835-
- build-linux-lite-release
836813
- build-examples
837814
- build-fuzzers
838815
- build-linux-clang-no_test_run

CMakeLists.txt

-6
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
496496
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-memcmp")
497497
endif()
498498

499-
option(ROCKSDB_LITE "Build RocksDBLite version" OFF)
500-
if(ROCKSDB_LITE)
501-
add_definitions(-DROCKSDB_LITE)
502-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -Os")
503-
endif()
504-
505499
if(CMAKE_SYSTEM_NAME MATCHES "Cygwin")
506500
add_definitions(-fno-builtin-memcmp -DCYGWIN)
507501
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")

HISTORY.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Fixed a data race on `ColumnFamilyData::flush_reason` caused by concurrent flushes.
99

1010
### Feature Removal
11+
* Remove RocksDB Lite.
1112
* The feature block_cache_compressed is removed. Statistics related to it are removed too.
1213
* Remove deprecated Env::LoadEnv(). Use Env::CreateFromString() instead.
1314
* Remove deprecated FileSystem::Load(). Use FileSystem::CreateFromString() instead.

INSTALL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ to build a portable binary, add `PORTABLE=1` before your make commands, like thi
178178
gmake rocksdbjava
179179

180180
* **iOS**:
181-
* Run: `TARGET_OS=IOS make static_lib`. When building the project which uses rocksdb iOS library, make sure to define two important pre-processing macros: `ROCKSDB_LITE` and `IOS_CROSS_COMPILE`.
181+
* Run: `TARGET_OS=IOS make static_lib`. When building the project which uses rocksdb iOS library, make sure to define an important pre-processing macros: `IOS_CROSS_COMPILE`.
182182

183183
* **Windows** (Visual Studio 2017 to up):
184184
* Read and follow the instructions at CMakeLists.txt

Makefile

-39
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,9 @@ endif
8383

8484
$(info $$DEBUG_LEVEL is ${DEBUG_LEVEL})
8585

86-
# Lite build flag.
87-
LITE ?= 0
88-
ifeq ($(LITE), 0)
89-
ifneq ($(filter -DROCKSDB_LITE,$(OPT)),)
90-
# Be backward compatible and support older format where OPT=-DROCKSDB_LITE is
91-
# specified instead of LITE=1 on the command line.
92-
LITE=1
93-
endif
94-
else ifeq ($(LITE), 1)
95-
ifeq ($(filter -DROCKSDB_LITE,$(OPT)),)
96-
OPT += -DROCKSDB_LITE
97-
endif
98-
endif
99-
10086
# Figure out optimize level.
10187
ifneq ($(DEBUG_LEVEL), 2)
102-
ifeq ($(LITE), 0)
10388
OPTIMIZE_LEVEL ?= -O2
104-
else
105-
OPTIMIZE_LEVEL ?= -Os
106-
endif
10789
endif
10890
# `OPTIMIZE_LEVEL` is empty when the user does not set it and `DEBUG_LEVEL=2`.
10991
# In that case, the compiler default (`-O0` for gcc and clang) will be used.
@@ -337,13 +319,6 @@ endif
337319
ifeq ($(PLATFORM), OS_SOLARIS)
338320
PLATFORM_CXXFLAGS += -D _GLIBCXX_USE_C99
339321
endif
340-
ifneq ($(filter -DROCKSDB_LITE,$(OPT)),)
341-
# found
342-
CFLAGS += -fno-exceptions
343-
CXXFLAGS += -fno-exceptions
344-
# LUA is not supported under ROCKSDB_LITE
345-
LUA_PATH =
346-
endif
347322

348323
ifeq ($(LIB_MODE),shared)
349324
# So that binaries are executable from build location, in addition to install location
@@ -1082,13 +1057,11 @@ check: all
10821057
rm -rf $(TEST_TMPDIR)
10831058
ifneq ($(PLATFORM), OS_AIX)
10841059
$(PYTHON) tools/check_all_python.py
1085-
ifeq ($(filter -DROCKSDB_LITE,$(OPT)),)
10861060
ifndef ASSERT_STATUS_CHECKED # not yet working with these tests
10871061
$(PYTHON) tools/ldb_test.py
10881062
sh tools/rocksdb_dump_test.sh
10891063
endif
10901064
endif
1091-
endif
10921065
ifndef SKIP_FORMAT_BUCK_CHECKS
10931066
$(MAKE) check-format
10941067
$(MAKE) check-buck-targets
@@ -2489,18 +2462,6 @@ build_size:
24892462
$(REPORT_BUILD_STATISTIC) rocksdb.build_size.shared_lib $$(stat --printf="%s" `readlink -f librocksdb.so`)
24902463
strip `readlink -f librocksdb.so`
24912464
$(REPORT_BUILD_STATISTIC) rocksdb.build_size.shared_lib_stripped $$(stat --printf="%s" `readlink -f librocksdb.so`)
2492-
# === lite build, static ===
2493-
$(MAKE) clean
2494-
$(MAKE) LITE=1 static_lib
2495-
$(REPORT_BUILD_STATISTIC) rocksdb.build_size.static_lib_lite $$(stat --printf="%s" librocksdb.a)
2496-
strip librocksdb.a
2497-
$(REPORT_BUILD_STATISTIC) rocksdb.build_size.static_lib_lite_stripped $$(stat --printf="%s" librocksdb.a)
2498-
# === lite build, shared ===
2499-
$(MAKE) clean
2500-
$(MAKE) LITE=1 shared_lib
2501-
$(REPORT_BUILD_STATISTIC) rocksdb.build_size.shared_lib_lite $$(stat --printf="%s" `readlink -f librocksdb.so`)
2502-
strip `readlink -f librocksdb.so`
2503-
$(REPORT_BUILD_STATISTIC) rocksdb.build_size.shared_lib_lite_stripped $$(stat --printf="%s" `readlink -f librocksdb.so`)
25042465

25052466
# ---------------------------------------------------------------------------
25062467
# Platform-specific compilation

ROCKSDB_LITE.md

-21
This file was deleted.

build_tools/build_detect_platform

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ case "$TARGET_OS" in
154154
;;
155155
IOS)
156156
PLATFORM=IOS
157-
COMMON_FLAGS="$COMMON_FLAGS -DOS_MACOSX -DIOS_CROSS_COMPILE -DROCKSDB_LITE"
157+
COMMON_FLAGS="$COMMON_FLAGS -DOS_MACOSX -DIOS_CROSS_COMPILE "
158158
PLATFORM_SHARED_EXT=dylib
159159
PLATFORM_SHARED_LDFLAGS="-dynamiclib -install_name "
160160
CROSS_COMPILE=true

cache/cache.cc

-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "util/string_util.h"
1717

1818
namespace ROCKSDB_NAMESPACE {
19-
#ifndef ROCKSDB_LITE
2019
static std::unordered_map<std::string, OptionTypeInfo>
2120
lru_cache_options_type_info = {
2221
{"capacity",
@@ -64,7 +63,6 @@ static std::unordered_map<std::string, OptionTypeInfo>
6463
OptionType::kBoolean, OptionVerificationType::kNormal,
6564
OptionTypeFlags::kMutable}},
6665
};
67-
#endif // ROCKSDB_LITE
6866

6967
Status SecondaryCache::CreateFromString(
7068
const ConfigOptions& config_options, const std::string& value,
@@ -75,7 +73,6 @@ Status SecondaryCache::CreateFromString(
7573
Status status;
7674
std::shared_ptr<SecondaryCache> sec_cache;
7775

78-
#ifndef ROCKSDB_LITE
7976
CompressedSecondaryCacheOptions sec_cache_opts;
8077
status = OptionTypeInfo::ParseStruct(config_options, "",
8178
&comp_sec_cache_options_type_info, "",
@@ -84,11 +81,6 @@ Status SecondaryCache::CreateFromString(
8481
sec_cache = NewCompressedSecondaryCache(sec_cache_opts);
8582
}
8683

87-
#else
88-
(void)config_options;
89-
status = Status::NotSupported(
90-
"Cannot load compressed secondary cache in LITE mode ", args);
91-
#endif //! ROCKSDB_LITE
9284

9385
if (status.ok()) {
9486
result->swap(sec_cache);
@@ -108,18 +100,13 @@ Status Cache::CreateFromString(const ConfigOptions& config_options,
108100
if (value.find('=') == std::string::npos) {
109101
cache = NewLRUCache(ParseSizeT(value));
110102
} else {
111-
#ifndef ROCKSDB_LITE
112103
LRUCacheOptions cache_opts;
113104
status = OptionTypeInfo::ParseStruct(config_options, "",
114105
&lru_cache_options_type_info, "",
115106
value, &cache_opts);
116107
if (status.ok()) {
117108
cache = NewLRUCache(cache_opts);
118109
}
119-
#else
120-
(void)config_options;
121-
status = Status::NotSupported("Cannot load cache in LITE mode ", value);
122-
#endif //! ROCKSDB_LITE
123110
}
124111
if (status.ok()) {
125112
result->swap(cache);

cache/cache_bench_tool.cc

-4
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,9 @@ DEFINE_bool(lean, false,
7777
"If true, no additional computation is performed besides cache "
7878
"operations.");
7979

80-
#ifndef ROCKSDB_LITE
8180
DEFINE_string(secondary_cache_uri, "",
8281
"Full URI for creating a custom secondary cache object");
8382
static class std::shared_ptr<ROCKSDB_NAMESPACE::SecondaryCache> secondary_cache;
84-
#endif // ROCKSDB_LITE
8583

8684
DEFINE_string(cache_type, "lru_cache", "Type of block cache.");
8785

@@ -305,7 +303,6 @@ class CacheBench {
305303
LRUCacheOptions opts(FLAGS_cache_size, FLAGS_num_shard_bits,
306304
false /* strict_capacity_limit */,
307305
0.5 /* high_pri_pool_ratio */);
308-
#ifndef ROCKSDB_LITE
309306
if (!FLAGS_secondary_cache_uri.empty()) {
310307
Status s = SecondaryCache::CreateFromString(
311308
ConfigOptions(), FLAGS_secondary_cache_uri, &secondary_cache);
@@ -318,7 +315,6 @@ class CacheBench {
318315
}
319316
opts.secondary_cache = secondary_cache;
320317
}
321-
#endif // ROCKSDB_LITE
322318

323319
cache_ = NewLRUCache(opts);
324320
} else {

cache/compressed_secondary_cache_test.cc

-2
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,6 @@ class CompressedSecondaryCacheTestWithCompressionParam
817817
bool sec_cache_is_compressed_;
818818
};
819819

820-
#ifndef ROCKSDB_LITE
821820

822821
TEST_P(CompressedSecondaryCacheTestWithCompressionParam, BasicTestFromString) {
823822
std::shared_ptr<SecondaryCache> sec_cache{nullptr};
@@ -882,7 +881,6 @@ TEST_P(CompressedSecondaryCacheTestWithCompressionParam,
882881
BasicTestHelper(sec_cache, sec_cache_is_compressed_);
883882
}
884883

885-
#endif // ROCKSDB_LITE
886884

887885
TEST_P(CompressedSecondaryCacheTestWithCompressionParam, FailsTest) {
888886
FailsTest(sec_cache_is_compressed_);

cache/lru_cache_test.cc

-2
Original file line numberDiff line numberDiff line change
@@ -1975,7 +1975,6 @@ class LRUCacheWithStat : public LRUCache {
19751975
uint32_t lookup_count_;
19761976
};
19771977

1978-
#ifndef ROCKSDB_LITE
19791978

19801979
TEST_F(DBSecondaryCacheTest, LRUCacheDumpLoadBasic) {
19811980
LRUCacheOptions cache_opts(1024 * 1024 /* capacity */, 0 /* num_shard_bits */,
@@ -2590,7 +2589,6 @@ TEST_F(DBSecondaryCacheTest, TestSecondaryCacheOptionTwoDB) {
25902589
ASSERT_OK(DestroyDB(dbname2, options));
25912590
}
25922591

2593-
#endif // ROCKSDB_LITE
25942592

25952593
} // namespace ROCKSDB_NAMESPACE
25962594

db/blob/blob_file_completion_callback.h

-17
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,19 @@ class BlobFileCompletionCallback {
2323
const std::vector<std::shared_ptr<EventListener>>& listeners,
2424
const std::string& dbname)
2525
: event_logger_(event_logger), listeners_(listeners), dbname_(dbname) {
26-
#ifndef ROCKSDB_LITE
2726
sst_file_manager_ = sst_file_manager;
2827
mutex_ = mutex;
2928
error_handler_ = error_handler;
30-
#else
31-
(void)sst_file_manager;
32-
(void)mutex;
33-
(void)error_handler;
34-
#endif // ROCKSDB_LITE
3529
}
3630

3731
void OnBlobFileCreationStarted(const std::string& file_name,
3832
const std::string& column_family_name,
3933
int job_id,
4034
BlobFileCreationReason creation_reason) {
41-
#ifndef ROCKSDB_LITE
4235
// Notify the listeners.
4336
EventHelpers::NotifyBlobFileCreationStarted(listeners_, dbname_,
4437
column_family_name, file_name,
4538
job_id, creation_reason);
46-
#else
47-
(void)file_name;
48-
(void)column_family_name;
49-
(void)job_id;
50-
(void)creation_reason;
51-
#endif
5239
}
5340

5441
Status OnBlobFileCompleted(const std::string& file_name,
@@ -61,7 +48,6 @@ class BlobFileCompletionCallback {
6148
uint64_t blob_count, uint64_t blob_bytes) {
6249
Status s;
6350

64-
#ifndef ROCKSDB_LITE
6551
auto sfm = static_cast<SstFileManagerImpl*>(sst_file_manager_);
6652
if (sfm) {
6753
// Report new blob files to SstFileManagerImpl
@@ -74,7 +60,6 @@ class BlobFileCompletionCallback {
7460
error_handler_->SetBGError(s, BackgroundErrorReason::kFlush);
7561
}
7662
}
77-
#endif // !ROCKSDB_LITE
7863

7964
// Notify the listeners.
8065
EventHelpers::LogAndNotifyBlobFileCreationFinished(
@@ -89,11 +74,9 @@ class BlobFileCompletionCallback {
8974
}
9075

9176
private:
92-
#ifndef ROCKSDB_LITE
9377
SstFileManager* sst_file_manager_;
9478
InstrumentedMutex* mutex_;
9579
ErrorHandler* error_handler_;
96-
#endif // ROCKSDB_LITE
9780
EventLogger* event_logger_;
9881
std::vector<std::shared_ptr<EventListener>> listeners_;
9982
std::string dbname_;

db/blob/blob_source.cc

-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ BlobSource::BlobSource(const ImmutableOptions* immutable_options,
3030
blob_file_cache_(blob_file_cache),
3131
blob_cache_(immutable_options->blob_cache),
3232
lowest_used_cache_tier_(immutable_options->lowest_used_cache_tier) {
33-
#ifndef ROCKSDB_LITE
3433
auto bbto =
3534
immutable_options->table_factory->GetOptions<BlockBasedTableOptions>();
3635
if (bbto &&
@@ -39,7 +38,6 @@ BlobSource::BlobSource(const ImmutableOptions* immutable_options,
3938
blob_cache_ = SharedCacheInterface{std::make_shared<ChargedCache>(
4039
immutable_options->blob_cache, bbto->block_cache)};
4140
}
42-
#endif // ROCKSDB_LITE
4341
}
4442

4543
BlobSource::~BlobSource() = default;

db/blob/blob_source_test.cc

-2
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,6 @@ class BlobSourceCacheReservationTest : public DBTestBase {
13911391
std::string db_session_id_;
13921392
};
13931393

1394-
#ifndef ROCKSDB_LITE
13951394
TEST_F(BlobSourceCacheReservationTest, SimpleCacheReservation) {
13961395
options_.cf_paths.emplace_back(
13971396
test::PerThreadDBPath(
@@ -1606,7 +1605,6 @@ TEST_F(BlobSourceCacheReservationTest, IncreaseCacheReservationOnFullCache) {
16061605
}
16071606
}
16081607
}
1609-
#endif // ROCKSDB_LITE
16101608

16111609
} // namespace ROCKSDB_NAMESPACE
16121610

0 commit comments

Comments
 (0)