Skip to content

Commit

Permalink
compaction after ingest sst files (FISCO-BCOS#4592)
Browse files Browse the repository at this point in the history
  • Loading branch information
bxq2011hust authored Aug 23, 2024
1 parent b5cb345 commit ba6a83f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libinitializer/Initializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,13 @@ bcos::Error::Ptr ingestIntoRocksDB(
std::cerr << "Error while adding file, " << status.ToString() << std::endl;
return BCOS_ERROR_PTR(-1, "Error while adding file, " + status.ToString());
}
// compaction
status = rocksDB.CompactRange(rocksdb::CompactRangeOptions(), nullptr, nullptr);
if (!status.ok())
{
std::cerr << "compaction failed, " << status.ToString() << std::endl;
return BCOS_ERROR_PTR(-1, "compaction failed, " + status.ToString());
}
return nullptr;
}

Expand Down

0 comments on commit ba6a83f

Please sign in to comment.