From b7d32e053d3d5b80c5be0e0d0e8457141f9d1b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Fri, 14 Nov 2014 09:13:13 +0200 Subject: [PATCH] MDEV-7083: sys_vars.innodb_sched_priority* tests fail in buildbot on work-amd64-valgrind Fixed issue by finding out first the current used priority for both treads and using that seeing did we really change the priority or not. --- storage/xtradb/handler/ha_innodb.cc | 36 +++++++++++++++++------------ 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index d0d8f4d282b..4adcddfd904 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -16510,20 +16510,21 @@ innodb_sched_priority_purge_update( ut_ad(purge_sys->state == PURGE_STATE_RUN); for (ulint i = 0; i < srv_n_purge_threads; i++) { - + ulint nice = os_thread_get_priority(srv_purge_tids[i]); ulint actual_priority = os_thread_set_priority(srv_purge_tids[i], priority); if (UNIV_UNLIKELY(actual_priority != priority)) { - - push_warning_printf(thd, + if (actual_priority+nice != priority) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_WRONG_ARGUMENTS, "Failed to set the purge " "thread priority to %lu, the " - "current priority is %lu, " + "nice is %lu the current priority is %lu, " "aborting priority update", - priority, actual_priority); - return; + priority, nice, actual_priority); + return; + } } } @@ -16548,21 +16549,23 @@ innodb_sched_priority_io_update( ulint priority = *static_cast(save); for (ulint i = 0; i < srv_n_file_io_threads; i++) { - + ulint nice = os_thread_get_priority(srv_io_tids[i]); ulint actual_priority = os_thread_set_priority(srv_io_tids[i], priority); if (UNIV_UNLIKELY(actual_priority != priority)) { - push_warning_printf(thd, + if (actual_priority+nice != priority) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_WRONG_ARGUMENTS, "Failed to set the I/O " "thread priority to %lu, the " - "current priority is %lu, " + "nice is %lu the current priority is %lu, " "aborting priority update", - priority, actual_priority); - return; + priority, nice, actual_priority); + return; + } } } @@ -16586,20 +16589,23 @@ innodb_sched_priority_master_update( { ulint priority = *static_cast(save); ulint actual_priority; + ulint nice; if (srv_read_only_mode) { return; } + nice = os_thread_get_priority(srv_master_tid); actual_priority = os_thread_set_priority(srv_master_tid, priority); if (UNIV_UNLIKELY(actual_priority != priority)) { - - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + if (actual_priority+nice != priority) { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_WRONG_ARGUMENTS, "Failed to set the master thread " "priority to %lu, " - "the current priority is %lu", priority, - actual_priority); + "the nice is %lu and the current priority is %lu", priority, + nice, actual_priority); + } } else { srv_sched_priority_master = priority;