diff --git a/src/kvstore/RocksEngine.cpp b/src/kvstore/RocksEngine.cpp index 73bdb14e104..12db0cbf110 100644 --- a/src/kvstore/RocksEngine.cpp +++ b/src/kvstore/RocksEngine.cpp @@ -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(); diff --git a/src/kvstore/test/RocksEngineTest.cpp b/src/kvstore/test/RocksEngineTest.cpp index 66eddedff2c..09903a4f6de 100644 --- a/src/kvstore/test/RocksEngineTest.cpp +++ b/src/kvstore/test/RocksEngineTest.cpp @@ -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"); @@ -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 data; for (TagID tagId = 0; tagId < 10; tagId++) {