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,22 +16510,23 @@ 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)) {
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);
priority, nice, actual_priority);
return;
}
}
}
srv_sched_priority_purge = priority;
}
@ -16548,23 +16549,25 @@ innodb_sched_priority_io_update(
ulint priority = *static_cast<const ulint *>(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)) {
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);
priority, nice, actual_priority);
return;
}
}
}
srv_sched_priority_io = priority;
}
@ -16586,20 +16589,23 @@ innodb_sched_priority_master_update(
{
ulint priority = *static_cast<const lint *>(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)) {
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;