Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL)
-
None
Description
dict_stats_schedule() 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.
The fix could be to revert commit 7c7f9bef28a, use mutex locks, not trylocks, and resolve the deadlock somehow differently.