diff --git a/server/modules/monitor/galera_mon.c b/server/modules/monitor/galera_mon.c index f2e633db7..bbde5ca49 100644 --- a/server/modules/monitor/galera_mon.c +++ b/server/modules/monitor/galera_mon.c @@ -447,10 +447,15 @@ size_t nrounds = 0; } /** Wait base interval */ thread_millisleep(MON_BASE_INTERVAL_MS); - - /** If monitor interval time isn't consumed skip checks */ - if (nrounds != 0 && - (nrounds*MON_BASE_INTERVAL_MS)%handle->interval != 0) + /** + * Calculate how far away the monitor interval is from its full + * cycle and if monitor interval time further than the base + * interval, then skip monitoring checks. Excluding the first + * round. + */ + if (nrounds != 0 && + ((nrounds*MON_BASE_INTERVAL_MS)%handle->interval) > + MON_BASE_INTERVAL_MS) { nrounds += 1; continue; diff --git a/server/modules/monitor/mysql_mon.c b/server/modules/monitor/mysql_mon.c index 4d917314f..c4cea23ee 100644 --- a/server/modules/monitor/mysql_mon.c +++ b/server/modules/monitor/mysql_mon.c @@ -611,10 +611,15 @@ size_t nrounds = 0; } /** Wait base interval */ thread_millisleep(MON_BASE_INTERVAL_MS); - - /** If monitor interval time isn't consumed skip checks */ - if (nrounds != 0 && - (nrounds*MON_BASE_INTERVAL_MS)%handle->interval != 0) + /** + * Calculate how far away the monitor interval is from its full + * cycle and if monitor interval time further than the base + * interval, then skip monitoring checks. Excluding the first + * round. + */ + if (nrounds != 0 && + ((nrounds*MON_BASE_INTERVAL_MS)%handle->interval) > + MON_BASE_INTERVAL_MS) { nrounds += 1; continue; diff --git a/server/modules/monitor/ndbcluster_mon.c b/server/modules/monitor/ndbcluster_mon.c index 46f5dd9ec..b35af4fe2 100644 --- a/server/modules/monitor/ndbcluster_mon.c +++ b/server/modules/monitor/ndbcluster_mon.c @@ -445,10 +445,15 @@ size_t nrounds = 0; /** Wait base interval */ thread_millisleep(MON_BASE_INTERVAL_MS); - - /** If monitor interval time isn't consumed skip checks */ - if (nrounds != 0 && - (nrounds*MON_BASE_INTERVAL_MS)%handle->interval != 0) + /** + * Calculate how far away the monitor interval is from its full + * cycle and if monitor interval time further than the base + * interval, then skip monitoring checks. Excluding the first + * round. + */ + if (nrounds != 0 && + ((nrounds*MON_BASE_INTERVAL_MS)%handle->interval) > + MON_BASE_INTERVAL_MS) { nrounds += 1; continue;