Skip to content

Commit e571eaa

Browse files
author
Jan Lindström
committed
MDEV-23328 Server hang due to Galera lock conflict resolution
Use better error message when KILL fails even in case TOI fails.
1 parent ea23903 commit e571eaa

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

mysql-test/suite/galera/r/galera_to_error.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Killing server ...
1515
connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1;
1616
connection node_1c;
1717
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
18-
ERROR 40001: WSREP replication failed. Check your wsrep connection state and retry the query.
19-
ERROR 40001: WSREP replication failed. Check your wsrep connection state and retry the query.
18+
Got one of the listed errors
19+
Got one of the listed errors
2020
CREATE UNIQUE INDEX b2 ON t2(b);
21-
ERROR 08S01: WSREP has not yet prepared node for application use
21+
Got one of the listed errors
2222
connection node_1;
2323
disconnect node_1a;
2424
disconnect node_1b;

mysql-test/suite/galera/t/galera_to_error.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ BEGIN;
3434

3535
--connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1
3636
--connection node_1c
37-
--error ER_LOCK_DEADLOCK
37+
--error ER_LOCK_DEADLOCK,ER_UNKNOWN_COM_ERROR
3838
CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
3939

4040
--disable_query_log
41-
--error ER_LOCK_DEADLOCK
41+
--error ER_LOCK_DEADLOCK, ER_CANNOT_USER,ER_KILL_QUERY_DENIED_ERROR
4242
--eval KILL QUERY $k_thread;
4343
--enable_query_log
4444

4545
# Reset the master and restart the slave so that post-test checks can run
46-
--error 1047
46+
--error ER_LOCK_DEADLOCK,ER_UNKNOWN_COM_ERROR
4747
CREATE UNIQUE INDEX b2 ON t2(b);
4848

4949
--connection node_1

sql/sql_parse.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9093,7 +9093,9 @@ void sql_kill(THD *thd, longlong id, killed_state state, killed_type type)
90939093
#ifdef WITH_WSREP
90949094
return;
90959095
wsrep_error_label:
9096-
my_error(ER_CANNOT_USER, MYF(0), " ");
9096+
error= (type == KILL_TYPE_QUERY ? ER_KILL_QUERY_DENIED_ERROR :
9097+
ER_KILL_DENIED_ERROR);
9098+
my_error(error, MYF(0), id);
90979099
#endif /* WITH_WSREP */
90989100
}
90999101

@@ -9128,7 +9130,7 @@ void sql_kill_user(THD *thd, LEX_USER *user, killed_state state)
91289130
#ifdef WITH_WSREP
91299131
return;
91309132
wsrep_error_label:
9131-
my_error(ER_CANNOT_USER, MYF(0), " ");
9133+
my_error(ER_CANNOT_USER, MYF(0), user ? user->user.str : "NULL");
91329134
#endif /* WITH_WSREP */
91339135
}
91349136

0 commit comments

Comments
 (0)