mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
MDEV-27805: tpcc workload shows regression with MDB-10.6
- regression got revealed while running tpcc workload. - as part of MDEV-25919 changes logic for statistics computation was revamped. - if the table has changed to certain threshold then table is added to statistics recomputation queue (dict_stats_recalc_pool_add) - after the table is added to queue the background statistics thread is notified - during revamp the condition to notify background statistics threads was wrongly updated to check if the queue/vector is empty when it should check if there is queue/vector has entries to process. - vec.begin() == vec.end() : only when vector is empty - also accessing these iterator outside the parallely changing vector is not safe - fix now tend to notify background statistics thread if the logic adds an entry to the queue/vector.
This commit is contained in:
parent
cce994057b
commit
fb875055c6
1 changed files with 3 additions and 2 deletions
|
@ -108,17 +108,18 @@ static void dict_stats_recalc_pool_add(table_id_t id)
|
|||
{
|
||||
ut_ad(!srv_read_only_mode);
|
||||
ut_ad(id);
|
||||
bool schedule = false;
|
||||
mysql_mutex_lock(&recalc_pool_mutex);
|
||||
|
||||
const auto begin= recalc_pool.begin(), end= recalc_pool.end();
|
||||
if (end == std::find_if(begin, end, [&](const recalc &r){return r.id == id;}))
|
||||
{
|
||||
recalc_pool.emplace_back(recalc{id, recalc::IDLE});
|
||||
schedule = true;
|
||||
}
|
||||
|
||||
mysql_mutex_unlock(&recalc_pool_mutex);
|
||||
|
||||
if (begin == end)
|
||||
if (schedule)
|
||||
dict_stats_schedule_now();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue