Deadlock with LOCK BINLOG FOR BACKUP + SHOW SLAVE STATUS with binary log enabled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
High
|
Alexey Kopytov | ||
5.1 |
Invalid
|
Undecided
|
Unassigned | ||
5.5 |
Invalid
|
Undecided
|
Unassigned | ||
5.6 |
Fix Released
|
High
|
Alexey Kopytov |
Bug Description
Reporting a problem described in bug #1358836 separately.
When the binary log is enabled on a replication slave, SHOW SLAVE STATUS
performed under an active BINLOG lock can lead to a deadlock.
The root cause is similar to http://
with the only difference being LOCK BINLOG FOR BACKUP instead of FTWRL:
- a slave SQL thread grabs Relay_log_
- if the commit is blocked on a binlog protection lock, then SHOW SLAVE
STATUS executed in a connection holding the binlog lock will try lock
Relay_log_
The fix is to make sure that an SQL thread does not acquire binlog
protection locks while holding Relay_log_
Related branches
- Laurynas Biveinis (community): Approve
-
Diff: 1000 lines (+487/-45)16 files modifiedmysql-test/suite/rpl/r/rpl_backup_locks.result (+7/-0)
mysql-test/suite/rpl/r/rpl_backup_locks_mts.result (+30/-0)
mysql-test/suite/rpl/r/rpl_bug1358836.result (+18/-0)
mysql-test/suite/rpl/t/rpl_backup_locks.test (+32/-0)
mysql-test/suite/rpl/t/rpl_backup_locks_mts-slave.opt (+1/-0)
mysql-test/suite/rpl/t/rpl_backup_locks_mts.test (+84/-0)
mysql-test/suite/rpl/t/rpl_bug1358836-slave.opt (+1/-0)
mysql-test/suite/rpl/t/rpl_bug1358836.test (+49/-0)
sql/binlog.cc (+13/-3)
sql/log_event.cc (+21/-0)
sql/rpl_info_factory.cc (+24/-0)
sql/rpl_rli.cc (+55/-21)
sql/rpl_rli.h (+17/-8)
sql/rpl_rli_pdb.cc (+56/-13)
sql/rpl_slave.cc (+77/-0)
sql/sql_class.h (+2/-0)
summary: |
- Deadlock with LOCK BINLOG FOR BACKUP + SHOW SLAVE STATUS + Deadlock with LOCK BINLOG FOR BACKUP + SHOW SLAVE STATUS with binary log + enabled |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PS-821