Bug#34409 LOCK_plugin contention via ha_release_temporary_latches/plugin_foreach
use thread-local data structures in ha_release_temporary_latches()
This commit is contained in:
parent
9115320342
commit
6077ebea1c
@ -1618,23 +1618,23 @@ bool mysql_xa_recover(THD *thd)
|
|||||||
@return
|
@return
|
||||||
always 0
|
always 0
|
||||||
*/
|
*/
|
||||||
static my_bool release_temporary_latches(THD *thd, plugin_ref plugin,
|
|
||||||
void *unused)
|
|
||||||
{
|
|
||||||
handlerton *hton= plugin_data(plugin, handlerton *);
|
|
||||||
|
|
||||||
if (hton->state == SHOW_OPTION_YES && hton->release_temporary_latches)
|
|
||||||
hton->release_temporary_latches(hton, thd);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int ha_release_temporary_latches(THD *thd)
|
int ha_release_temporary_latches(THD *thd)
|
||||||
{
|
{
|
||||||
plugin_foreach(thd, release_temporary_latches, MYSQL_STORAGE_ENGINE_PLUGIN,
|
Ha_trx_info *info;
|
||||||
NULL);
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Note that below we assume that only transactional storage engines
|
||||||
|
may need release_temporary_latches(). If this will ever become false,
|
||||||
|
we could iterate on thd->open_tables instead (and remove duplicates
|
||||||
|
as if (!seen[hton->slot]) { seen[hton->slot]=1; ... }).
|
||||||
|
*/
|
||||||
|
for (info= thd->transaction.stmt.ha_list; info; info= info->next())
|
||||||
|
{
|
||||||
|
handlerton *hton= info->ht();
|
||||||
|
if (hton && hton->release_temporary_latches)
|
||||||
|
hton->release_temporary_latches(hton, thd);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user