1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-26 07:02:12 +03:00
Files
mariadb/sql
Sergei Golubchik 29bbcac0ee MDEV-23328 Server hang due to Galera lock conflict resolution
mutex order violation here.
when wsrep bf thread kills a conflicting trx, the stack is

  wsrep_thd_LOCK()
  wsrep_kill_victim()
  lock_rec_other_has_conflicting()
  lock_clust_rec_read_check_and_lock()
  row_search_mvcc()
  ha_innobase::index_read()
  ha_innobase::rnd_pos()
  handler::ha_rnd_pos()
  handler::rnd_pos_by_record()
  handler::ha_rnd_pos_by_record()
  Rows_log_event::find_row()
  Update_rows_log_event::do_exec_row()
  Rows_log_event::do_apply_event()
  Log_event::apply_event()
  wsrep_apply_events()

and mutexes are taken in the order

  lock_sys->mutex -> victim_trx->mutex -> victim_thread->LOCK_thd_data

When a normal KILL statement is executed, the stack is

  innobase_kill_query()
  kill_handlerton()
  plugin_foreach_with_mask()
  ha_kill_query()
  THD::awake()
  kill_one_thread()

and mutexes are

  victim_thread->LOCK_thd_data -> lock_sys->mutex -> victim_trx->mutex

To fix the mutex order violation we kill the victim thd asynchronously,
from the manager thread
2021-01-24 11:35:55 +01:00
..
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2020-08-02 11:05:29 +02:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 19:15:57 +03:00
2019-05-11 21:29:06 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2020-09-03 09:10:03 +03:00
2019-05-13 17:54:04 +03:00
2020-08-02 11:05:29 +02:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 21:29:06 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2020-07-22 23:18:12 +02:00
2019-05-13 17:54:04 +03:00
2020-08-02 11:05:29 +02:00
2019-05-11 21:29:06 +03:00
2019-05-11 21:29:06 +03:00
2020-08-02 11:05:29 +02:00
2019-05-11 22:19:05 +03:00
2020-08-02 11:05:29 +02:00
2020-07-14 15:10:59 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2020-08-02 11:05:29 +02:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 21:29:06 +03:00
2020-08-02 11:05:29 +02:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2020-08-02 11:05:29 +02:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2020-08-02 11:05:29 +02:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2020-08-02 11:05:29 +02:00
2020-09-22 15:21:43 +03:00
2020-10-23 15:53:41 +02:00
2020-10-23 15:53:41 +02:00
2020-08-02 11:05:29 +02:00
2020-08-02 11:05:29 +02:00
2019-07-26 07:03:39 +02:00
2019-05-13 17:54:04 +03:00
2019-05-11 21:29:06 +03:00
2020-08-02 11:05:29 +02:00
2020-08-02 11:05:29 +02:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 21:29:06 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 21:29:06 +03:00
2019-06-25 13:21:36 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-06-12 22:54:46 +02:00
2019-06-12 22:54:46 +02:00
2020-07-02 06:05:13 +03:00
2019-05-11 21:29:06 +03:00
2020-09-03 09:10:03 +03:00
2020-05-26 13:01:34 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-06-25 13:21:36 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 21:29:06 +03:00
2019-05-11 21:29:06 +03:00
2019-05-11 22:19:05 +03:00
2020-09-03 09:10:03 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-07-09 13:22:22 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2020-06-01 09:33:03 +03:00
2020-06-01 09:33:03 +03:00
2020-07-01 12:03:55 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 21:29:06 +03:00
2020-01-17 00:24:17 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2020-07-14 15:10:59 +03:00
2019-05-13 17:54:04 +03:00
2020-03-18 13:55:21 +04:00
2019-05-11 22:19:05 +03:00
2019-06-12 10:30:01 +03:00
2019-06-12 10:30:01 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-06-23 20:33:13 +03:00
2019-06-13 16:42:21 +02:00
2019-05-13 17:54:04 +03:00
2020-05-19 10:42:59 +03:00
2019-05-11 21:29:06 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 19:25:02 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 21:29:06 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-28 15:56:24 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 21:29:06 +03:00
2019-06-25 13:21:36 +03:00
2019-05-11 22:19:05 +03:00
2019-07-26 07:03:39 +02:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 19:25:02 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 19:25:02 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 21:29:06 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-06-13 16:42:21 +02:00
2019-05-11 19:25:02 +03:00
2019-05-11 19:25:02 +03:00
2019-05-11 21:29:06 +03:00
2019-05-11 21:29:06 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 19:15:57 +03:00
2019-05-10 20:52:00 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 21:29:06 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 21:29:06 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 21:29:06 +03:00
2020-07-20 14:53:24 +03:00
2020-09-03 09:10:03 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-11 21:29:06 +03:00
2019-05-13 17:54:04 +03:00
2020-06-05 18:32:37 +02:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2020-10-20 12:01:37 +02:00
2019-05-11 21:29:06 +03:00
2019-05-11 21:29:06 +03:00
2019-05-13 17:54:04 +03:00
2021-01-24 11:35:55 +01:00
2019-05-13 17:54:04 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2020-10-28 10:56:38 +01:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2020-07-21 23:12:32 +10:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-11 21:29:06 +03:00
2020-08-20 06:00:36 +03:00
2019-05-11 21:29:06 +03:00
2019-05-13 17:54:04 +03:00
2020-06-11 22:35:30 +03:00
2020-06-12 10:55:53 +03:00
2020-07-15 09:49:48 +02:00
2019-05-10 20:52:00 +03:00
2019-05-11 22:19:05 +03:00
2019-05-13 17:54:04 +03:00
2020-06-05 18:32:37 +02:00
2019-05-11 19:25:02 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00
2019-05-13 17:54:04 +03:00