mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
correctness assert
thd_get_ha_data() can be used without a lock, but only from the
current thd thread, when calling from anoher thread it *must*
be protected by thd->LOCK_thd_data
* fix group commit code to take thd->LOCK_thd_data
* remove innobase_close_connection() from the innodb background thread,
it's not needed after 87775402cd
and was failing the assert with
current_thd==0
This commit is contained in:
@ -437,6 +437,7 @@ void safe_mutex_free_deadlock_data(safe_mutex_t *mp);
|
|||||||
#define my_cond_wait(A,B) safe_cond_wait((A), (B), __FILE__, __LINE__)
|
#define my_cond_wait(A,B) safe_cond_wait((A), (B), __FILE__, __LINE__)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#define safe_mutex_is_owner(mp) (1)
|
||||||
#define safe_mutex_assert_owner(mp) do {} while (0)
|
#define safe_mutex_assert_owner(mp) do {} while (0)
|
||||||
#define safe_mutex_assert_not_owner(mp) do {} while (0)
|
#define safe_mutex_assert_not_owner(mp) do {} while (0)
|
||||||
#define safe_mutex_setflags(mp, F) do {} while (0)
|
#define safe_mutex_setflags(mp, F) do {} while (0)
|
||||||
|
@ -8512,7 +8512,11 @@ MYSQL_BIN_LOG::trx_group_commit_leader(group_commit_entry *leader)
|
|||||||
++num_commits;
|
++num_commits;
|
||||||
if (current->cache_mngr->using_xa && likely(!current->error) &&
|
if (current->cache_mngr->using_xa && likely(!current->error) &&
|
||||||
DBUG_EVALUATE_IF("skip_commit_ordered", 0, 1))
|
DBUG_EVALUATE_IF("skip_commit_ordered", 0, 1))
|
||||||
|
{
|
||||||
|
mysql_mutex_lock(¤t->thd->LOCK_thd_data);
|
||||||
run_commit_ordered(current->thd, current->all);
|
run_commit_ordered(current->thd, current->all);
|
||||||
|
mysql_mutex_unlock(¤t->thd->LOCK_thd_data);
|
||||||
|
}
|
||||||
current->thd->wakeup_subsequent_commits(current->error);
|
current->thd->wakeup_subsequent_commits(current->error);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -462,6 +462,7 @@ void thd_storage_lock_wait(THD *thd, long long value)
|
|||||||
extern "C"
|
extern "C"
|
||||||
void *thd_get_ha_data(const THD *thd, const struct handlerton *hton)
|
void *thd_get_ha_data(const THD *thd, const struct handlerton *hton)
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(thd == current_thd || mysql_mutex_is_owner(&thd->LOCK_thd_data));
|
||||||
return thd->ha_data[hton->slot].ha_ptr;
|
return thd->ha_data[hton->slot].ha_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1484,10 +1484,6 @@ innobase_destroy_background_thd(
|
|||||||
/*============================*/
|
/*============================*/
|
||||||
MYSQL_THD thd)
|
MYSQL_THD thd)
|
||||||
{
|
{
|
||||||
/* need to close the connection explicitly, the server won't do it
|
|
||||||
if innodb is in the PLUGIN_IS_DYING state */
|
|
||||||
innobase_close_connection(innodb_hton_ptr, thd);
|
|
||||||
thd_set_ha_data(thd, innodb_hton_ptr, NULL);
|
|
||||||
destroy_background_thd(thd);
|
destroy_background_thd(thd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user