From 877f2a521da46360afe37192852af18751afae75 Mon Sep 17 00:00:00 2001 From: mrambacher Date: Sun, 15 Oct 2023 03:20:38 -0400 Subject: [PATCH] Fix some build issues (#664) 1. Fix the tests so that the pass (as well as they do for RocksDB) when ASSERT_STATUS_CHECKED is defined; 2. Fix the "set by unused" variable warning in db_bench on MacOS --- db/import_column_family_job.cc | 12 ++++++------ tools/db_bench_tool.cc | 2 ++ utilities/ttl/ttl_test.cc | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/db/import_column_family_job.cc b/db/import_column_family_job.cc index 6a7217b0d7..cb123d015a 100644 --- a/db/import_column_family_job.cc +++ b/db/import_column_family_job.cc @@ -41,16 +41,14 @@ namespace ROCKSDB_NAMESPACE { Status ImportColumnFamilyJob::Prepare(uint64_t next_file_number, SuperVersion* sv) { - Status status; - // Read the information of files we are importing for (const auto& file_metadata : metadata_) { const auto file_path = file_metadata.db_path + "/" + file_metadata.name; IngestedFileInfo file_to_import; - status = GetIngestedFileInfo(file_path, next_file_number++, sv, - file_metadata, &file_to_import); - if (!status.ok()) { - return status; + Status s = GetIngestedFileInfo(file_path, next_file_number++, sv, + file_metadata, &file_to_import); + if (!s.ok()) { + return s; } files_to_import_.push_back(file_to_import); } @@ -70,6 +68,8 @@ Status ImportColumnFamilyJob::Prepare(uint64_t next_file_number, } } + Status status; + // Copy/Move external files into DB auto hardlink_files = import_options_.move_files; for (auto& f : files_to_import_) { diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index d03522104d..c0218b5c3b 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -7717,6 +7717,8 @@ class Benchmark { thread->stats.FinishedOps(&single_db, single_db.db, 1, kSeek); } + (void)num_seek_to_first; + (void)num_next; delete iter; } diff --git a/utilities/ttl/ttl_test.cc b/utilities/ttl/ttl_test.cc index ab48fe90fe..0c48dd5717 100644 --- a/utilities/ttl/ttl_test.cc +++ b/utilities/ttl/ttl_test.cc @@ -1008,7 +1008,7 @@ TEST_F(TtlTest, SkipExpiredReadOnlyTtlMultiGetTest) { ASSERT_OK(DBWithTTL::Open(options, dbname_, &db_ttl_, ttl_)); ASSERT_OK(db_ttl_->Put(WriteOptions(), key_1, put_value)); ASSERT_OK(db_ttl_->Put(WriteOptions(), key_2, put_value)); - db_ttl_->Close(); + ASSERT_OK(db_ttl_->Close()); ASSERT_OK(DBWithTTL::Open(options, dbname_, &db_ttl_, ttl_, true)); env_->Sleep(ttl_ + 1); auto statuses = db_ttl_->MultiGet(ropts, {key_1, key_2}, &values); @@ -1030,7 +1030,7 @@ TEST_F(TtlTest, GetNotExpiredReadOnlyTtlGetTest) { std::string put_value = "val"; ASSERT_OK(DBWithTTL::Open(options, dbname_, &db_ttl_, ttl_)); ASSERT_OK(db_ttl_->Put(WriteOptions(), key, put_value)); - db_ttl_->Close(); + ASSERT_OK(db_ttl_->Close()); // open ttl as read only ASSERT_OK(DBWithTTL::Open(options, dbname_, &db_ttl_, ttl_, true)); env_->Sleep(ttl_ + 1);