summaryrefslogtreecommitdiff
path: root/sql/wsrep_thd.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-05-10 13:01:42 +0200
committerSergei Golubchik <serg@mariadb.org>2018-05-10 13:01:42 +0200
commit9b1824dcd2564c803e58d02ac63b49ec68bd60d2 (patch)
treebeef3faf3e0e6b8264014a0cfb735d4a32be6cbc /sql/wsrep_thd.cc
parent92a13148e80c30422ae5460032169cbe1946fa6d (diff)
parentff579bc814551026a3271fac274f560cef3f523f (diff)
downloadmariadb-git-9b1824dcd2564c803e58d02ac63b49ec68bd60d2.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/wsrep_thd.cc')
-rw-r--r--sql/wsrep_thd.cc38
1 files changed, 19 insertions, 19 deletions
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index d62c38580b6..15eed2e10e6 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -47,7 +47,7 @@ int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, char *buff,
return 0;
}
-/* must have (&thd->LOCK_wsrep_thd) */
+/* must have (&thd->LOCK_thd_data) */
void wsrep_client_rollback(THD *thd)
{
WSREP_DEBUG("client rollback due to BF abort for (%lld), query: %s",
@@ -56,7 +56,7 @@ void wsrep_client_rollback(THD *thd)
WSREP_ATOMIC_ADD_LONG(&wsrep_bf_aborts_counter, 1);
thd->wsrep_conflict_state= ABORTING;
- mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
+ mysql_mutex_unlock(&thd->LOCK_thd_data);
trans_rollback(thd);
if (thd->locked_tables_mode && thd->lock)
@@ -86,7 +86,7 @@ void wsrep_client_rollback(THD *thd)
(longlong) thd->thread_id);
thd->clear_binlog_table_maps();
}
- mysql_mutex_lock(&thd->LOCK_wsrep_thd);
+ mysql_mutex_lock(&thd->LOCK_thd_data);
thd->wsrep_conflict_state= ABORTED;
}
@@ -231,7 +231,7 @@ void wsrep_replay_transaction(THD *thd)
thd->get_stmt_da()->reset_diagnostics_area();
thd->wsrep_conflict_state= REPLAYING;
- mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
+ mysql_mutex_unlock(&thd->LOCK_thd_data);
thd->reset_for_next_command();
thd->reset_killed();
@@ -271,7 +271,7 @@ void wsrep_replay_transaction(THD *thd)
if (thd->wsrep_conflict_state!= REPLAYING)
WSREP_WARN("lost replaying mode: %d", thd->wsrep_conflict_state );
- mysql_mutex_lock(&thd->LOCK_wsrep_thd);
+ mysql_mutex_lock(&thd->LOCK_thd_data);
switch (rcode)
{
@@ -329,7 +329,7 @@ void wsrep_replay_transaction(THD *thd)
/* we're now in inconsistent state, must abort */
/* http://bazaar.launchpad.net/~codership/codership-mysql/5.6/revision/3962#sql/wsrep_thd.cc */
- mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
+ mysql_mutex_unlock(&thd->LOCK_thd_data);
unireg_abort(1);
break;
@@ -496,30 +496,30 @@ static void wsrep_rollback_process(THD *thd)
*/
mysql_mutex_unlock(&LOCK_wsrep_rollback);
- mysql_mutex_lock(&aborting->LOCK_wsrep_thd);
+ mysql_mutex_lock(&aborting->LOCK_thd_data);
if (aborting->wsrep_conflict_state== ABORTED)
{
WSREP_DEBUG("WSREP, thd already aborted: %llu state: %d",
(long long)aborting->real_id,
aborting->wsrep_conflict_state);
- mysql_mutex_unlock(&aborting->LOCK_wsrep_thd);
+ mysql_mutex_unlock(&aborting->LOCK_thd_data);
mysql_mutex_lock(&LOCK_wsrep_rollback);
continue;
}
aborting->wsrep_conflict_state= ABORTING;
- mysql_mutex_unlock(&aborting->LOCK_wsrep_thd);
+ mysql_mutex_unlock(&aborting->LOCK_thd_data);
set_current_thd(aborting);
aborting->store_globals();
- mysql_mutex_lock(&aborting->LOCK_wsrep_thd);
+ mysql_mutex_lock(&aborting->LOCK_thd_data);
wsrep_client_rollback(aborting);
WSREP_DEBUG("WSREP rollbacker aborted thd: (%lld %lld)",
(longlong) aborting->thread_id,
(longlong) aborting->real_id);
- mysql_mutex_unlock(&aborting->LOCK_wsrep_thd);
+ mysql_mutex_unlock(&aborting->LOCK_thd_data);
set_current_thd(thd);
thd->store_globals();
@@ -559,10 +559,10 @@ enum wsrep_conflict_state wsrep_thd_conflict_state(THD *thd, my_bool sync)
enum wsrep_conflict_state state = NO_CONFLICT;
if (thd)
{
- if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd);
+ if (sync) mysql_mutex_lock(&thd->LOCK_thd_data);
state = thd->wsrep_conflict_state;
- if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
+ if (sync) mysql_mutex_unlock(&thd->LOCK_thd_data);
}
return state;
}
@@ -586,12 +586,12 @@ my_bool wsrep_thd_is_BF(THD *thd, my_bool sync)
if (wsrep_thd_is_wsrep(thd))
{
if (sync)
- mysql_mutex_lock(&thd->LOCK_wsrep_thd);
+ mysql_mutex_lock(&thd->LOCK_thd_data);
status = ((thd->wsrep_exec_mode == REPL_RECV) ||
(thd->wsrep_exec_mode == TOTAL_ORDER));
if (sync)
- mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
+ mysql_mutex_unlock(&thd->LOCK_thd_data);
}
}
return status;
@@ -604,12 +604,12 @@ my_bool wsrep_thd_is_BF_or_commit(void *thd_ptr, my_bool sync)
if (thd_ptr)
{
THD* thd = (THD*)thd_ptr;
- if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd);
+ if (sync) mysql_mutex_lock(&thd->LOCK_thd_data);
status = ((thd->wsrep_exec_mode == REPL_RECV) ||
(thd->wsrep_exec_mode == TOTAL_ORDER) ||
(thd->wsrep_exec_mode == LOCAL_COMMIT));
- if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
+ if (sync) mysql_mutex_unlock(&thd->LOCK_thd_data);
}
return status;
}
@@ -621,10 +621,10 @@ my_bool wsrep_thd_is_local(void *thd_ptr, my_bool sync)
if (thd_ptr)
{
THD* thd = (THD*)thd_ptr;
- if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd);
+ if (sync) mysql_mutex_lock(&thd->LOCK_thd_data);
status = (thd->wsrep_exec_mode == LOCAL_STATE);
- if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
+ if (sync) mysql_mutex_unlock(&thd->LOCK_thd_data);
}
return status;
}