diff --git a/src/memgraph.cpp b/src/memgraph.cpp index ca03024fe..cdb1e63df 100644 --- a/src/memgraph.cpp +++ b/src/memgraph.cpp @@ -607,15 +607,15 @@ int main(int argc, char **argv) { // to minimize the impact of their failure on the main storage. memgraph::io::local_transport::LocalSystem ls; - auto unique_local_coord_addr_query = memgraph::coordinator::Address::UniqueLocalAddress(); - auto io = ls.Register(unique_local_coord_addr_query); + auto unique_local_addr_query = memgraph::coordinator::Address::UniqueLocalAddress(); + auto io = ls.Register(unique_local_addr_query); memgraph::machine_manager::MachineConfig config{ - .coordinator_addresses = std::vector{unique_local_coord_addr_query}, + .coordinator_addresses = std::vector{unique_local_addr_query}, .is_storage = true, .is_coordinator = true, - .listen_ip = unique_local_coord_addr_query.last_known_ip, - .listen_port = unique_local_coord_addr_query.last_known_port, + .listen_ip = unique_local_addr_query.last_known_ip, + .listen_port = unique_local_addr_query.last_known_port, }; memgraph::coordinator::ShardMap sm; diff --git a/src/query/v2/interpreter.cpp b/src/query/v2/interpreter.cpp index 8042a763c..46a479f36 100644 --- a/src/query/v2/interpreter.cpp +++ b/src/query/v2/interpreter.cpp @@ -807,10 +807,10 @@ Interpreter::Interpreter(InterpreterContext *interpreter_context) : interpreter_ interpreter_context_->request_router_factory_->CreateRequestRouter(interpreter_context_->coordinator_address); // Get edge ids - const auto [min, max] = + const auto edge_ids_alloc_min_max_pair = request_router_->AllocateInitialEdgeIds(interpreter_context_->coordinator_address); if (edge_ids_alloc_min_max_pair) { - interpreter_context_->edge_ids_alloc = {min, max} + interpreter_context_->edge_ids_alloc = {edge_ids_alloc_min_max_pair->first, edge_ids_alloc_min_max_pair->second}; } } diff --git a/src/query/v2/request_router.hpp b/src/query/v2/request_router.hpp index 7ac5d1816..74117f52e 100644 --- a/src/query/v2/request_router.hpp +++ b/src/query/v2/request_router.hpp @@ -687,11 +687,10 @@ class LocalRequestRouterFactory : public RequestRouterFactory { class SimulatedRequestRouterFactory : public RequestRouterFactory { io::simulator::Simulator *simulator_; - coordinator::Address address_; public: - explicit SimulatedRequestRouterFactory(io::simulator::Simulator &simulator, coordinator::Address address) - : RequestRouterFactory(simulator.GetSimulatorHandle()), simulator_(&simulator), address_(address) {} + explicit SimulatedRequestRouterFactory(io::simulator::Simulator &simulator) + : RequestRouterFactory(simulator.GetSimulatorHandle()), simulator_(&simulator) {} std::unique_ptr CreateRequestRouter( const coordinator::Address &coordinator_address) const override { diff --git a/tests/simulation/CMakeLists.txt b/tests/simulation/CMakeLists.txt index f81f89798..28ff60b02 100644 --- a/tests/simulation/CMakeLists.txt +++ b/tests/simulation/CMakeLists.txt @@ -32,4 +32,4 @@ add_simulation_test(trial_query_storage/query_storage_test.cpp) add_simulation_test(sharded_map.cpp) add_simulation_test(shard_rsm.cpp) add_simulation_test(cluster_property_test.cpp) -add_simulation_test(cluster_property_test_v2.cpp) +add_simulation_test(cluster_property_test_cypher_queries.cpp) diff --git a/tests/simulation/cluster_property_test_v2.cpp b/tests/simulation/cluster_property_test_cypher_queries.cpp similarity index 100% rename from tests/simulation/cluster_property_test_v2.cpp rename to tests/simulation/cluster_property_test_cypher_queries.cpp diff --git a/tests/simulation/simulation_interpreter.hpp b/tests/simulation/simulation_interpreter.hpp index e25dfaa99..8e37f4f70 100644 --- a/tests/simulation/simulation_interpreter.hpp +++ b/tests/simulation/simulation_interpreter.hpp @@ -9,17 +9,17 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. +#include "io/simulator/simulator_handle.hpp" #include "machine_manager/machine_config.hpp" #include "machine_manager/machine_manager.hpp" -#include "io/simulator/simulator_handle.hpp" #include "query/v2/config.hpp" #include "query/v2/discard_value_stream.hpp" #include "query/v2/frontend/ast/ast.hpp" #include "query/v2/interpreter.hpp" #include "query/v2/request_router.hpp" -#include #include +#include // TODO(gvolfing) // -How to set up the entire raft cluster with the QE. Also provide abrstraction for that. @@ -33,7 +33,7 @@ class SimulatedInterpreter { public: explicit SimulatedInterpreter(std::unique_ptr interpreter_context) : interpreter_context_(std::move(interpreter_context)) { - interpreter_ = std::make_unique(interpreter_context_); + interpreter_ = std::make_unique(interpreter_context_.get()); } SimulatedInterpreter(const SimulatedInterpreter &) = delete; @@ -76,11 +76,10 @@ class SimulatedInterpreter { }; SimulatedInterpreter SetUpInterpreter(Address coordinator_address, Simulator &simulator) { - auto rr_factory = - std::make_unique(simulator, coordinator_address); + auto rr_factory = std::make_unique(simulator); auto interpreter_context = std::make_unique( - nullptr + nullptr, memgraph::query::v2::InterpreterConfig{.query = {.allow_load_csv = true}, .execution_timeout_sec = 600, .replication_replica_check_frequency = std::chrono::seconds(1),