From dc21511e6e912bf5a1db71460b8209ddf8364263 Mon Sep 17 00:00:00 2001 From: florijan Date: Mon, 26 Feb 2018 12:38:37 +0100 Subject: [PATCH] Fix remote edge create Summary: Difficult to test properly as the problem was an implicit conversion of `gid::Gid` to `mvcc::VersionList<> *`. The only proper way to defend against this would be to make `gid::Gid` a type. The `CHECK` added in this diff does not help, but should be there, so... Reviewers: dgleich Reviewed By: dgleich Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1244 --- src/distributed/remote_updates_rpc_server.hpp | 2 +- tests/unit/distributed_updates.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/distributed/remote_updates_rpc_server.hpp b/src/distributed/remote_updates_rpc_server.hpp index 5d5fe9526..004743e4e 100644 --- a/src/distributed/remote_updates_rpc_server.hpp +++ b/src/distributed/remote_updates_rpc_server.hpp @@ -185,7 +185,7 @@ class RemoteUpdatesRpcServer { if (creation_result.result == RemoteUpdateResult::DONE && data.to.worker_id() == db_.WorkerId()) { auto to_delta = database::StateDelta::AddInEdge( - data.tx_id, data.to.gid(), data.from, + data.tx_id, data.to.gid(), {data.from, db_.WorkerId()}, {creation_result.gid, db_.WorkerId()}, data.edge_type); creation_result.result = GetUpdates(vertex_updates_, data.tx_id).Emplace(to_delta); diff --git a/tests/unit/distributed_updates.cpp b/tests/unit/distributed_updates.cpp index 62c01e023..37d5ccee7 100644 --- a/tests/unit/distributed_updates.cpp +++ b/tests/unit/distributed_updates.cpp @@ -173,6 +173,8 @@ class DistributedEdgeCreateTest : public DistributedGraphDbTest { void CreateEdge(database::GraphDb &creator, storage::VertexAddress from_addr, storage::VertexAddress to_addr) { + CHECK(from_addr.is_remote() && to_addr.is_remote()) + << "Local address given to CreateEdge"; database::GraphDbAccessor dba{creator}; auto edge_type = dba.EdgeType("et"); VertexAccessor v1{from_addr, dba};