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
2 people authored and Sophie-Xie committed Jan 24, 2022
1 parent 1d5b1a6 commit bee9215
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 bee9215

Please sign in to comment.