[MDEV-450] Deadlock when setting replication system variables Created: 2012-08-13  Updated: 2012-08-14  Resolved: 2012-08-14

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.5.27

Type: Bug Priority: Minor
Reporter: Kristian Nielsen Assignee: Kristian Nielsen
Resolution: Fixed Votes: 0
Labels: None


 Description   

There are a number of deadlock problems when setting replication system
variables rpl_do_, rpl_ignore_, rpl_wild_*, slave_skip_counter,
slave_net_timeout.

The setting of these takes LOCK_active_mi (and some of them also
active_mi->rld.run_lock) while holding LOCK_global_system_variables. But slave
start takes these locks in the opposite order (due to THD::init() taking
LOCK_global_system_variables).

The fix is to temporarily unlock LOCK_global_system_variables while taking the
replication locks.

Thanks to Davi Arnaut for finding this bug and providing the fix:

https://github.com/twitter/mysql/commit/be79b5405c0d6528c936733270319dab7b1e289a



 Comments   
Comment by Kristian Nielsen [ 2012-08-14 ]

Patch looks good, thanks Davi!

Pushed to 5.5.

Generated at Thu Feb 08 06:28:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.