Skip to content

Commit

Permalink
fix upgrade (#3787)
Browse files Browse the repository at this point in the history
Co-authored-by: Doodle <[email protected]>
  • Loading branch information
cangfengzhs and critical27 authored Jan 24, 2022
1 parent 3094bea commit 11e6492
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tools/db-upgrade/DbUpgrader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,13 +910,17 @@ void UpgraderSpace::runPartV3() {
}
return;
}
int64_t ingestFileCount = 0;
auto write_sst = [&, this](const std::vector<kvstore::KV>& data) {
::rocksdb::Options option;
option.create_if_missing = true;
option.compression = ::rocksdb::CompressionType::kNoCompression;
::rocksdb::SstFileWriter sst_file_writer(::rocksdb::EnvOptions(), option);
std::string file = ::fmt::format(
".nebula_upgrade.space-{}.part-{}.{}.sst", spaceId_, partId, std::time(nullptr));
std::string file = ::fmt::format(".nebula_upgrade.space-{}.part-{}-{}-{}.sst",
spaceId_,
partId,
ingestFileCount++,
std::time(nullptr));
::rocksdb::Status s = sst_file_writer.Open(file);
if (!s.ok()) {
LOG(FATAL) << "Faild upgrade V3 of space " << spaceId_ << ", part " << partId << ":"
Expand Down

0 comments on commit 11e6492

Please sign in to comment.