From bee9215aaab1442ee98671d378525eb919ffda4c Mon Sep 17 00:00:00 2001 From: "hs.zhang" <22708345+cangfengzhs@users.noreply.github.com> Date: Mon, 24 Jan 2022 14:04:09 +0800 Subject: [PATCH] fix upgrade (#3787) Co-authored-by: Doodle <13706157+critical27@users.noreply.github.com> --- src/tools/db-upgrade/DbUpgrader.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tools/db-upgrade/DbUpgrader.cpp b/src/tools/db-upgrade/DbUpgrader.cpp index cf66ea4fc87..bc0cefdc394 100644 --- a/src/tools/db-upgrade/DbUpgrader.cpp +++ b/src/tools/db-upgrade/DbUpgrader.cpp @@ -910,13 +910,17 @@ void UpgraderSpace::runPartV3() { } return; } + int64_t ingestFileCount = 0; auto write_sst = [&, this](const std::vector& 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 << ":"