Skip to content

Commit

Permalink
Fix some build issues (#664)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mrambacher authored Oct 15, 2023
1 parent 6511a7d commit 877f2a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions db/import_column_family_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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_) {
Expand Down
2 changes: 2 additions & 0 deletions tools/db_bench_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions utilities/ttl/ttl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 877f2a5

Please sign in to comment.