Fix bug in storage v2 GC
Reviewers: mtomic, teon.banek Reviewed By: mtomic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2304
This commit is contained in:
parent
ce9e2614fa
commit
d263d0887f
@ -957,7 +957,7 @@ void Storage::CollectGarbage() {
|
|||||||
switch (prev.type) {
|
switch (prev.type) {
|
||||||
case PreviousPtr::Type::VERTEX: {
|
case PreviousPtr::Type::VERTEX: {
|
||||||
Vertex *vertex = prev.vertex;
|
Vertex *vertex = prev.vertex;
|
||||||
std::unique_lock<utils::SpinLock> vertex_guard(vertex->lock);
|
std::lock_guard<utils::SpinLock> vertex_guard(vertex->lock);
|
||||||
if (vertex->delta != &delta) {
|
if (vertex->delta != &delta) {
|
||||||
// Something changed, we're not the first delta in the chain
|
// Something changed, we're not the first delta in the chain
|
||||||
// anymore.
|
// anymore.
|
||||||
@ -971,12 +971,13 @@ void Storage::CollectGarbage() {
|
|||||||
}
|
}
|
||||||
case PreviousPtr::Type::EDGE: {
|
case PreviousPtr::Type::EDGE: {
|
||||||
Edge *edge = prev.edge;
|
Edge *edge = prev.edge;
|
||||||
std::unique_lock<utils::SpinLock> edge_guard(edge->lock);
|
std::lock_guard<utils::SpinLock> edge_guard(edge->lock);
|
||||||
if (edge->delta != &delta) {
|
if (edge->delta != &delta) {
|
||||||
// Something changed, we're not the first delta in the chain
|
// Something changed, we're not the first delta in the chain
|
||||||
// anymore.
|
// anymore.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
edge->delta = nullptr;
|
||||||
if (edge->deleted) {
|
if (edge->deleted) {
|
||||||
current_deleted_edges.push_back(edge->gid);
|
current_deleted_edges.push_back(edge->gid);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user