diff --git a/src/kvstore/KVStore.h b/src/kvstore/KVStore.h index f76b6d29112..254f569c233 100644 --- a/src/kvstore/KVStore.h +++ b/src/kvstore/KVStore.h @@ -106,9 +106,7 @@ class KVStore { * @param canReadFromFollower * @return const void* Snapshot. */ - virtual const void* GetSnapshot(GraphSpaceID spaceId, - PartitionID partID, - bool canReadFromFollower = false) = 0; + virtual const void* GetSnapshot(GraphSpaceID spaceId, PartitionID partID) = 0; /** * @brief Release snapshot. diff --git a/src/kvstore/NebulaStore.cpp b/src/kvstore/NebulaStore.cpp index 6eaa674a518..7d87695a1c4 100644 --- a/src/kvstore/NebulaStore.cpp +++ b/src/kvstore/NebulaStore.cpp @@ -732,17 +732,12 @@ nebula::cpp2::ErrorCode NebulaStore::get(GraphSpaceID spaceId, return part->engine()->get(key, value, snapshot); } -const void* NebulaStore::GetSnapshot(GraphSpaceID spaceId, - PartitionID partId, - bool canReadFromFollower) { +const void* NebulaStore::GetSnapshot(GraphSpaceID spaceId, PartitionID partId) { auto ret = part(spaceId, partId); if (!ok(ret)) { return nullptr; } auto part = nebula::value(ret); - if (!checkLeader(part, canReadFromFollower)) { - return nullptr; - } return part->engine()->GetSnapshot(); } diff --git a/src/kvstore/NebulaStore.h b/src/kvstore/NebulaStore.h index 15b92a9135c..81026187d15 100644 --- a/src/kvstore/NebulaStore.h +++ b/src/kvstore/NebulaStore.h @@ -191,12 +191,9 @@ class NebulaStore : public KVStore, public Handler { * * @param spaceId * @param partID - * @param canReadFromFollower * @return const void* Snapshot pointer. */ - const void* GetSnapshot(GraphSpaceID spaceId, - PartitionID partID, - bool canReadFromFollower = false) override; + const void* GetSnapshot(GraphSpaceID spaceId, PartitionID partID) override; /** * @brief Release snapshot from engine. diff --git a/src/kvstore/plugins/hbase/HBaseStore.h b/src/kvstore/plugins/hbase/HBaseStore.h index c264aa4bd1f..053e7504b62 100644 --- a/src/kvstore/plugins/hbase/HBaseStore.h +++ b/src/kvstore/plugins/hbase/HBaseStore.h @@ -75,9 +75,7 @@ class HBaseStore : public KVStore { return {-1, -1}; } - const void* GetSnapshot(GraphSpaceID spaceId, - PartitionID partID, - bool canReadFromFollower = false) override { + const void* GetSnapshot(GraphSpaceID spaceId, PartitionID partID) override { UNUSED(spaceId); UNUSED(partID); UNUSED(canReadFromFollower); diff --git a/src/storage/test/IndexTestUtil.h b/src/storage/test/IndexTestUtil.h index 8ad2c99a5e6..09ca3eae166 100644 --- a/src/storage/test/IndexTestUtil.h +++ b/src/storage/test/IndexTestUtil.h @@ -70,7 +70,7 @@ class MockKVStore : public ::nebula::kvstore::KVStore { return nebula::cpp2::ErrorCode::SUCCEEDED; } - const void* GetSnapshot(GraphSpaceID, PartitionID, bool) override { + const void* GetSnapshot(GraphSpaceID, PartitionID) override { return nullptr; } void ReleaseSnapshot(GraphSpaceID, PartitionID, const void*) override {}