Skip to content

Commit

Permalink
fix crash when drop space (#3185)
Browse files Browse the repository at this point in the history
  • Loading branch information
critical27 authored Oct 22, 2021
1 parent db6da98 commit b8dc6ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/kvstore/RocksEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ RocksEngine::RocksEngine(GraphSpaceID spaceId,
}
CHECK(status.ok()) << status.ToString();
db_.reset(db);
partsNum_ = allParts().size();
extractorLen_ = sizeof(PartitionID) + vIdLen;
partsNum_ = allParts().size();
LOG(INFO) << "open rocksdb on " << path;

backup();
Expand Down
7 changes: 7 additions & 0 deletions src/kvstore/test/RocksEngineTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,8 @@ TEST(RebuildPrefixBloomFilter, RebuildPrefixBloomFilter) {
EXPECT_EQ("123", value);
};

auto checkSystemPart = [&]() { EXPECT_EQ(10, engine->allParts().size()); };

checkVertexPrefix(1, "1");
checkVertexPrefix(1, "2");
checkVertexPrefix(2, "3");
Expand All @@ -748,11 +750,16 @@ TEST(RebuildPrefixBloomFilter, RebuildPrefixBloomFilter) {
checkEdgePartPrefix(2);
checkRangeWithPartPrefix(1);
checkRangeWithPartPrefix(2);
checkSystemPart();
checkSystemCommit(1);
checkSystemCommit(2);
};

auto writeData = [&engine] {
for (PartitionID partId = 1; partId <= 10; partId++) {
engine->addPart(partId);
}

LOG(INFO) << "Write some data";
std::vector<KV> data;
for (TagID tagId = 0; tagId < 10; tagId++) {
Expand Down

0 comments on commit b8dc6ac

Please sign in to comment.