Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix GetSnaphot will return nullptr #5420

Merged
merged 3 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/kvstore/KVStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 1 addition & 6 deletions src/kvstore/NebulaStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
5 changes: 1 addition & 4 deletions src/kvstore/NebulaStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions src/kvstore/plugins/hbase/HBaseStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down