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.
This commit is contained in:
Jan Lindström 2014-11-14 09:13:13 +02:00
parent 26b1113032
commit b7d32e053d

View File

@ -16510,20 +16510,21 @@ innodb_sched_priority_purge_update(
ut_ad(purge_sys->state == PURGE_STATE_RUN); ut_ad(purge_sys->state == PURGE_STATE_RUN);
for (ulint i = 0; i < srv_n_purge_threads; i++) { for (ulint i = 0; i < srv_n_purge_threads; i++) {
ulint nice = os_thread_get_priority(srv_purge_tids[i]);
ulint actual_priority ulint actual_priority
= os_thread_set_priority(srv_purge_tids[i], priority); = os_thread_set_priority(srv_purge_tids[i], priority);
if (UNIV_UNLIKELY(actual_priority != priority)) { if (UNIV_UNLIKELY(actual_priority != priority)) {
if (actual_priority+nice != priority) {
push_warning_printf(thd, push_warning_printf(thd,
Sql_condition::WARN_LEVEL_WARN, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS, ER_WRONG_ARGUMENTS,
"Failed to set the purge " "Failed to set the purge "
"thread priority to %lu, the " "thread priority to %lu, the "
"current priority is %lu, " "nice is %lu the current priority is %lu, "
"aborting priority update", "aborting priority update",
priority, actual_priority); priority, nice, actual_priority);
return; return;
}
} }
} }
@ -16548,21 +16549,23 @@ innodb_sched_priority_io_update(
ulint priority = *static_cast<const ulint *>(save); ulint priority = *static_cast<const ulint *>(save);
for (ulint i = 0; i < srv_n_file_io_threads; i++) { 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], ulint actual_priority = os_thread_set_priority(srv_io_tids[i],
priority); priority);
if (UNIV_UNLIKELY(actual_priority != 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, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS, ER_WRONG_ARGUMENTS,
"Failed to set the I/O " "Failed to set the I/O "
"thread priority to %lu, the " "thread priority to %lu, the "
"current priority is %lu, " "nice is %lu the current priority is %lu, "
"aborting priority update", "aborting priority update",
priority, actual_priority); priority, nice, actual_priority);
return; return;
}
} }
} }
@ -16586,20 +16589,23 @@ innodb_sched_priority_master_update(
{ {
ulint priority = *static_cast<const lint *>(save); ulint priority = *static_cast<const lint *>(save);
ulint actual_priority; ulint actual_priority;
ulint nice;
if (srv_read_only_mode) { if (srv_read_only_mode) {
return; return;
} }
nice = os_thread_get_priority(srv_master_tid);
actual_priority = os_thread_set_priority(srv_master_tid, priority); actual_priority = os_thread_set_priority(srv_master_tid, priority);
if (UNIV_UNLIKELY(actual_priority != priority)) { if (UNIV_UNLIKELY(actual_priority != priority)) {
if (actual_priority+nice != priority) {
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS, ER_WRONG_ARGUMENTS,
"Failed to set the master thread " "Failed to set the master thread "
"priority to %lu, " "priority to %lu, "
"the current priority is %lu", priority, "the nice is %lu and the current priority is %lu", priority,
actual_priority); nice, actual_priority);
}
} else { } else {
srv_sched_priority_master = priority; srv_sched_priority_master = priority;