From 38c5a76d0e16e0b4560795b7bc496ae3ffae1f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Thu, 26 Aug 2021 23:59:50 +0200 Subject: [PATCH] Use Aurora writer for reads if max_lag_ms isn't specified This solves the issue described in issue #3522 It is a side effect of a mistake in commit 5336e72f1cc22 --- lib/MySQL_HostGroups_Manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 3dd62f782..5fe9c2077 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -2843,7 +2843,7 @@ MySrvC *MyHGC::get_random_MySrvC(char * gtid_uuid, uint64_t gtid_trxid, int max_ } } } - if (max_lag_ms) { // we are using AWS Aurora, as this logic is implemented only here + if (max_lag_ms > 0) { // we are using AWS Aurora, as this logic is implemented only here unsigned int min_num_replicas = sess->thread->variables.aurora_max_lag_ms_only_read_from_replicas; if (min_num_replicas) { if (num_candidates >= min_num_replicas) { // there are at least N replicas