Skip to content

Commit

Permalink
Fix bug when ingesting files (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangleptr authored Nov 14, 2019
1 parent 132fa81 commit b614cab
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/kvstore/NebulaStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ ResultCode NebulaStore::ingest(GraphSpaceID spaceId) {
auto space = nebula::value(spaceRet);
for (auto& engine : space->engines_) {
auto parts = engine->allParts();
std::vector<std::string> extras;
for (auto part : parts) {
auto ret = this->engine(spaceId, part);
if (!ok(ret)) {
Expand All @@ -450,20 +449,17 @@ ResultCode NebulaStore::ingest(GraphSpaceID spaceId) {

auto path = folly::stringPrintf("%s/download/%d", value(ret)->getDataRoot(), part);
if (!fs::FileUtils::exist(path)) {
LOG(ERROR) << path << " not existed";
return ResultCode::ERR_IO_ERROR;
LOG(INFO) << path << " not existed";
continue;
}

auto files = nebula::fs::FileUtils::listAllFilesInDir(path.c_str(), true, "*.sst");
for (auto file : files) {
VLOG(3) << "Ingesting extra file: " << file;
extras.emplace_back(file);
}
}
if (extras.size() != 0) {
auto code = engine->ingest(std::move(extras));
if (code != ResultCode::SUCCEEDED) {
return code;
LOG(INFO) << "Ingesting extra file: " << file;
auto code = engine->ingest(std::vector<std::string>({file}));
if (code != ResultCode::SUCCEEDED) {
return code;
}
}
}
}
Expand Down

0 comments on commit b614cab

Please sign in to comment.