Skip to content

Commit

Permalink
fix bug (#4675)
Browse files Browse the repository at this point in the history
Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>
  • Loading branch information
cangfengzhs and Sophie-Xie authored Sep 26, 2022
1 parent a229752 commit cccc014
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/storage/admin/StatsTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ nebula::cpp2::ErrorCode StatsTask::genSubTask(GraphSpaceID spaceId,
edgetypeEdges[edge.first] = 0;
}

VertexID lastVertexId = "";

// Only stats valid vertex data, no multi version
// For example
// Vid tagId
Expand All @@ -166,8 +168,15 @@ nebula::cpp2::ErrorCode StatsTask::genSubTask(GraphSpaceID spaceId,
tagIter->next();
continue;
}
spaceVertices++;
tagsVertices[tagId] += 1;

if (vId == lastVertexId) {
tagsVertices[tagId] += 1;
} else {
tagsVertices[tagId] += 1;
spaceVertices++;
lastVertexId = vId;
}

tagIter->next();
sleepIfScannedSomeRecord(++countToSleep);
}
Expand Down
7 changes: 6 additions & 1 deletion src/storage/mutate/AddVerticesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ void AddVerticesProcessor::doProcess(const cpp2::AddVerticesRequest& req) {
code = nebula::cpp2::ErrorCode::E_INVALID_VID;
break;
}
if (FLAGS_use_vertex_key) {
data.emplace_back(NebulaKeyUtils::vertexKey(spaceVidLen_, partId, vid), "");
}
for (auto& newTag : newTags) {
auto tagId = newTag.get_tag_id();
VLOG(3) << "PartitionID: " << partId << ", VertexID: " << vid << ", TagID: " << tagId;
Expand Down Expand Up @@ -158,7 +161,9 @@ void AddVerticesProcessor::doProcessWithIndex(const cpp2::AddVerticesRequest& re
code = nebula::cpp2::ErrorCode::E_INVALID_VID;
break;
}

if (FLAGS_use_vertex_key) {
verticeData.emplace_back(NebulaKeyUtils::vertexKey(spaceVidLen_, partId, vid));
}
for (const auto& newTag : newTags) {
auto tagId = newTag.get_tag_id();
VLOG(3) << "PartitionID: " << partId << ", VertexID: " << vid << ", TagID: " << tagId;
Expand Down

0 comments on commit cccc014

Please sign in to comment.