Merge pull request #628 from memgraph/T1138-MG-fix-edge-id-allocator

Fix passing of edge IdAllocator not by value but as pointer
This commit is contained in:
János Benjamin Antal 2022-11-02 10:40:35 +01:00 committed by GitHub
commit 4d96bf5006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,7 @@ struct ExecutionContext {
ExecutionStats execution_stats;
utils::AsyncTimer timer;
msgs::ShardRequestManagerInterface *shard_request_manager{nullptr};
IdAllocator edge_ids_alloc;
IdAllocator *edge_ids_alloc;
};
static_assert(std::is_move_assignable_v<ExecutionContext>, "ExecutionContext must be move assignable!");

View File

@ -697,7 +697,7 @@ PullPlan::PullPlan(const std::shared_ptr<CachedPlan> plan, const Parameters &par
ctx_.is_shutting_down = &interpreter_context->is_shutting_down;
ctx_.is_profile_query = is_profile_query;
ctx_.shard_request_manager = shard_request_manager;
ctx_.edge_ids_alloc = interpreter_context->edge_ids_alloc;
ctx_.edge_ids_alloc = &interpreter_context->edge_ids_alloc;
}
std::optional<plan::ProfilingStatsWithTotalTime> PullPlan::Pull(AnyStream *stream, std::optional<int> n,

View File

@ -2422,7 +2422,7 @@ class DistributedCreateExpandCursor : public Cursor {
std::vector<msgs::NewExpand> ExpandCreationInfoToRequest(ExecutionContext &context, Frame &frame) const {
std::vector<msgs::NewExpand> edge_requests;
for (const auto &edge_info : std::vector{self_.edge_info_}) {
msgs::NewExpand request{.id = {context.edge_ids_alloc.AllocateId()}};
msgs::NewExpand request{.id = {context.edge_ids_alloc->AllocateId()}};
ExpressionEvaluator evaluator(&frame, context.symbol_table, context.evaluation_context, nullptr,
storage::v3::View::NEW);
request.type = {edge_info.edge_type};