diff --git a/src/storage/v3/shard.cpp b/src/storage/v3/shard.cpp index dbf1f043f..79093449c 100644 --- a/src/storage/v3/shard.cpp +++ b/src/storage/v3/shard.cpp @@ -444,7 +444,7 @@ ShardResult>>> EdgeAccessor e(edge, edge_type, from_vertex, vertex_id, transaction_, &shard_->indices_, config_); auto ret = DeleteEdge(e.FromVertex(), e.ToVertex(), e.Gid()); if (ret.HasError()) { - MG_ASSERT(ret.GetError().code == common::ErrorCode::SERIALIZATION_ERROR, "Invalid database state!"); + MG_ASSERT(ret.GetError() == common::ErrorCode::SERIALIZATION_ERROR, "Invalid database state!"); return ret.GetError(); } @@ -457,7 +457,7 @@ ShardResult>>> EdgeAccessor e(edge, edge_type, vertex_id, to_vertex, transaction_, &shard_->indices_, config_); auto ret = DeleteEdge(e.FromVertex(), e.ToVertex(), e.Gid()); if (ret.HasError()) { - MG_ASSERT(ret.GetError().code == common::ErrorCode::SERIALIZATION_ERROR, "Invalid database state!"); + MG_ASSERT(ret.GetError() == common::ErrorCode::SERIALIZATION_ERROR, "Invalid database state!"); return ret.GetError(); } diff --git a/src/storage/v3/shard_rsm.cpp b/src/storage/v3/shard_rsm.cpp index aac045fe4..62f46b944 100644 --- a/src/storage/v3/shard_rsm.cpp +++ b/src/storage/v3/shard_rsm.cpp @@ -355,16 +355,11 @@ ShardResult GetExpandOneResult( result_row.src_vertex_properties = std::move(*src_vertex_properties); static constexpr bool kInEdges = true; static constexpr bool kOutEdges = false; - if (!in_edges.empty()) { - if (const auto fill_edges_res = FillEdges(in_edges, result_row, edge_filler); fill_edges_res.HasError()) { - return fill_edges_res.GetError(); - } + if (const auto fill_edges_res = FillEdges(in_edges, result_row, edge_filler); fill_edges_res.HasError()) { + return fill_edges_res.GetError(); } - if (!out_edges.empty()) { - if (const auto fill_edges_res = FillEdges(out_edges, result_row, edge_filler); - fill_edges_res.HasError()) { - return fill_edges_res.GetError(); - } + if (const auto fill_edges_res = FillEdges(out_edges, result_row, edge_filler); fill_edges_res.HasError()) { + return fill_edges_res.GetError(); } return result_row; @@ -447,7 +442,6 @@ EdgeFiller InitializeEdgeFillerFunction(const msgs::ExpandOneRequest &req) { return {}; }; } else { - // TODO(gvolfing) - do we want to set the action_successful here? edge_filler = [&req](const EdgeAccessor &edge, const bool is_in_edge, msgs::ExpandOneResultRow &result_row) -> ShardResult { std::vector value_properties; @@ -555,8 +549,6 @@ msgs::WriteResponses ShardRsm::ApplyWrite(msgs::DeleteVerticesRequest &&req) { auto vertex_acc = acc.FindVertex(ConvertPropertyVector(std::move(propval)), View::OLD); if (!vertex_acc) { - spdlog::debug("Error while trying to delete vertex. Vertex to delete does not exist. Transaction id: {}", - req.transaction_id.logical_id); shard_error.emplace(msgs::ShardError{common::ErrorCode::OBJECT_NOT_FOUND}); spdlog::debug("In transaction {} vertex could not be found while trying to delete it.", req.transaction_id.logical_id); diff --git a/tests/unit/storage_v3.cpp b/tests/unit/storage_v3.cpp index cab463b7f..6f6902d1c 100644 --- a/tests/unit/storage_v3.cpp +++ b/tests/unit/storage_v3.cpp @@ -2657,7 +2657,7 @@ TEST_P(StorageV3, TestCreateVertexAndValidate) { ASSERT_TRUE(vertex2.HasError()); auto error = vertex2.GetError(); - ASSERT_TRUE(error.code == common::ErrorCode::VERTEX_ALREADY_INSERTED); + ASSERT_TRUE(error == common::ErrorCode::VERTEX_ALREADY_INSERTED); } { auto acc = store.Access(GetNextHlc());