From cf26350138d2741777df6d0859f61be7a140193b Mon Sep 17 00:00:00 2001 From: Valentin Rakush Date: Tue, 12 Nov 2019 18:56:53 +0000 Subject: [PATCH] Fix for min lag. Use std::max --- lib/MySQL_Monitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index 81f029bbf..4deb0dc60 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -4695,7 +4695,7 @@ void MySQL_Monitor::evaluate_aws_aurora_results(unsigned int wHG, unsigned int r if (strcmp(prev_hse->server_id,hse->server_id)==0) { bool prev_enabled = true; - unsigned int prev_lag_ms = std::min(((unsigned int)prev_hse->replica_lag_ms + add_lag_ms), min_lag_ms); + unsigned int prev_lag_ms = std::max(((unsigned int)prev_hse->replica_lag_ms + add_lag_ms), min_lag_ms); if (prev_lag_ms > max_latency_ms) { prev_enabled = false; }