Merge branch 'project-pineapples' into T1079-MG-add-simple-query-to-benchmark_v2
This commit is contained in:
commit
f063c1b1ad
@ -73,8 +73,7 @@ bool SimulatorHandle::MaybeTickSimulator() {
|
||||
|
||||
// We tick the clock forward when all servers are blocked but
|
||||
// there are no in-flight messages to schedule delivery of.
|
||||
std::poisson_distribution<> time_distrib(50);
|
||||
Duration clock_advance = std::chrono::microseconds{time_distrib(rng_)};
|
||||
const Duration clock_advance = std::chrono::microseconds{time_distrib_(rng_)};
|
||||
cluster_wide_time_microseconds_ += clock_advance;
|
||||
|
||||
MG_ASSERT(cluster_wide_time_microseconds_ < config_.abort_time,
|
||||
@ -93,8 +92,7 @@ bool SimulatorHandle::MaybeTickSimulator() {
|
||||
auto [to_address, opaque_message] = std::move(in_flight_.back());
|
||||
in_flight_.pop_back();
|
||||
|
||||
std::uniform_int_distribution<int> drop_distrib(0, 99);
|
||||
const int drop_threshold = drop_distrib(rng_);
|
||||
const int drop_threshold = drop_distrib_(rng_);
|
||||
const bool should_drop = drop_threshold < config_.drop_percent;
|
||||
|
||||
if (should_drop) {
|
||||
|
@ -51,6 +51,8 @@ class SimulatorHandle {
|
||||
std::set<Address> blocked_on_receive_;
|
||||
std::set<Address> server_addresses_;
|
||||
std::mt19937 rng_;
|
||||
std::uniform_int_distribution<int> time_distrib_{5, 50};
|
||||
std::uniform_int_distribution<int> drop_distrib_{0, 99};
|
||||
SimulatorConfig config_;
|
||||
|
||||
void TimeoutPromisesPastDeadline() {
|
||||
|
@ -690,7 +690,7 @@ int main(int argc, char **argv) {
|
||||
std::optional<memgraph::telemetry::Telemetry> telemetry;
|
||||
|
||||
// Handler for regular termination signals
|
||||
auto shutdown = [&server, &interpreter_context] {
|
||||
auto shutdown = [&server, &interpreter_context, &ls] {
|
||||
// Server needs to be shutdown first and then the database. This prevents
|
||||
// a race condition when a transaction is accepted during server shutdown.
|
||||
server.Shutdown();
|
||||
@ -698,6 +698,7 @@ int main(int argc, char **argv) {
|
||||
// connections we tell the execution engine to stop processing all pending
|
||||
// queries.
|
||||
memgraph::query::v2::Shutdown(&interpreter_context);
|
||||
ls.ShutDown();
|
||||
};
|
||||
|
||||
InitSignalHandlers(shutdown);
|
||||
|
Loading…
Reference in New Issue
Block a user