Commit aff5ed39 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-33046 race condition in InnoDB dict_stats_schedule()

it can be invoked with ms=0. In that case dict_stats_func is
invoked immediately, it calls dict_stats_process_entry_from_recalc_pool()
which at the end might try to call dict_stats_schedule() again to
queue another recalc. And it can happen that the first
dict_stats_schedule(0) call didn't release dict_stats_mutex yet,
so the second dict_stats_schedule() won't queue a recalc. And as a
result the table won't have its stats recalculated at all, not now,
not later.

This causes innodb.innodb_stats_auto_recalc to fail sporadically.

This commit doesn't fix it but makes it less likely to occur which happens
to be enough for the test to pass. Proper fix is coming soon.
parent 0930eb86
...@@ -412,7 +412,7 @@ static void dict_stats_schedule(int ms) ...@@ -412,7 +412,7 @@ static void dict_stats_schedule(int ms)
void dict_stats_schedule_now() void dict_stats_schedule_now()
{ {
dict_stats_schedule(0); dict_stats_schedule(10);
} }
/** Shut down the dict_stats_thread. */ /** Shut down the dict_stats_thread. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment