Skip to content

Commit 25aaa65

Browse files
author
Nirbhay Choubey
committed
MDEV-6832: ER_LOCK_WAIT_TIMEOUT on SHOW STATUS
Synchronous read view should not be needed for SHOW commands.
1 parent 96e505e commit 25aaa65

File tree

7 files changed

+36
-4
lines changed

7 files changed

+36
-4
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# MDEV-6832: ER_LOCK_WAIT_TIMEOUT on SHOW STATUS
3+
#
4+
SHOW STATUS LIKE 'wsrep_ready';
5+
Variable_name Value
6+
wsrep_ready ON
7+
SHOW STATUS LIKE 'wsrep_ready';
8+
Variable_name Value
9+
wsrep_ready OFF
10+
SET @@global.wsrep_cluster_address='gcomm://';
11+
# End of test.

mysql-test/suite/wsrep/r/variables.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ SET GLOBAL wsrep_provider=none;
141141
#
142142
# MDEV#6206: wsrep_slave_threads subtracts from max_connections
143143
#
144-
call mtr.add_suppression("safe_mutex: Found wrong usage of mutex 'LOCK_wsrep_slave_threads' and 'LOCK_global_system_variables'");
145144
call mtr.add_suppression("WSREP: Failed to get provider options");
146145
SELECT @@global.wsrep_provider;
147146
@@global.wsrep_provider
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep_provider_options='base_port=$GALERA_BASE_PORT' --wsrep-on=1 --wsrep_causal_reads=ON
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--source include/have_wsrep_provider.inc
2+
--source include/have_binlog_format_row.inc
3+
4+
--echo #
5+
--echo # MDEV-6832: ER_LOCK_WAIT_TIMEOUT on SHOW STATUS
6+
--echo #
7+
8+
SHOW STATUS LIKE 'wsrep_ready';
9+
--disable_query_log
10+
eval SET @@global.wsrep_provider='$WSREP_PROVIDER';
11+
--enable_query_log
12+
SHOW STATUS LIKE 'wsrep_ready';
13+
SET @@global.wsrep_cluster_address='gcomm://';
14+
15+
--echo # End of test.

mysql-test/suite/wsrep/t/variables.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ SET GLOBAL wsrep_provider=none;
7878
--echo #
7979
--echo # MDEV#6206: wsrep_slave_threads subtracts from max_connections
8080
--echo #
81-
call mtr.add_suppression("safe_mutex: Found wrong usage of mutex 'LOCK_wsrep_slave_threads' and 'LOCK_global_system_variables'");
8281
call mtr.add_suppression("WSREP: Failed to get provider options");
8382

8483
--disable_query_log

sql/sql_parse.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,10 +2754,10 @@ mysql_execute_command(THD *thd)
27542754
#endif
27552755
case SQLCOM_SHOW_STATUS:
27562756
{
2757+
execute_show_status(thd, all_tables);
27572758
#ifdef WITH_WSREP
2758-
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
2759+
wsrep_free_status(thd);
27592760
#endif /* WITH_WSREP */
2760-
execute_show_status(thd, all_tables);
27612761
break;
27622762
}
27632763
case SQLCOM_SHOW_EXPLAIN:

sql/wsrep_var.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,14 @@ bool wsrep_cluster_address_update (sys_var *self, THD* thd, enum_var_type type)
365365
*/
366366
mysql_mutex_unlock(&LOCK_global_system_variables);
367367
wsrep_stop_replication(thd);
368+
369+
/*
370+
Unlock and lock LOCK_wsrep_slave_threads to maintain lock order & avoid
371+
any potential deadlock.
372+
*/
373+
mysql_mutex_unlock(&LOCK_wsrep_slave_threads);
368374
mysql_mutex_lock(&LOCK_global_system_variables);
375+
mysql_mutex_lock(&LOCK_wsrep_slave_threads);
369376

370377
if (wsrep_start_replication())
371378
{

0 commit comments

Comments
 (0)