A sequence of LOCK TABLES FOR BACKUP and STOP SLAVE SQL_THREAD can cause replication to be blocked and cannot be restarted normally

Description

Using Percona Server 5.7.22 to reproduce:

On, Master, create many tables:

 

 

On Slave, run:

 

The processlist on slave would look like this:

 

SHOW SLAVE STATUS shows that replication is blocked

 

At this point, a kill -9, is the only way to get replication back running because shutting down normally is blocked too.

 

Environment

None

AFFECTED CS IDs

234659

Activity

Satya Bodapati 
September 11, 2019 at 2:18 PM
(edited)

We will revert our fix in .0.17(only for LOCK INSTANCE FOR BACKUP) because of above commit.
Our commit anyway doesn't handle Clone plugin

Satya Bodapati 
September 11, 2019 at 2:17 PM

Added upstream tag because the part to handle "LOCK INSTANCE FOR BACKUP;" is fixed by Oracle in 8.0.17

commit 7e75ca24a273bd2e1aaa662e6712025c4dd8e0ca
Author: Pedro Figueiredo <pedro.figueiredo@oracle.com>
Date: Tue Apr 23 14:57:48 2019 +0100

BUG#29386503 STOP SLAVE SQL_THREAD DEADLOCKS IF DONE WHILE HOLDING LOCK INSTANCE FOR BACKUP

Jaime Sicam 
August 22, 2018 at 12:58 PM

Although, if you do not kill the system user, and you try to stop MySQL, it will hang and then you would need to do a hard kill to stop MySQL.

Jaime Sicam 
August 22, 2018 at 12:56 PM

Hi Laurynas,

  At first I thought there would be a need to do a hard kill to get replication to stop and started so it could be a potential DOS for replication. After doing some tests again and Sveta's reference, you can easily get the lock back by killing the system user.

Laurynas Biveinis 
August 22, 2018 at 12:47 PM

, uses LOCK BINLOG FOR BACKUP, and this one LOCK TABLES FOR BACKUP

Done

Details

Assignee

Reporter

Upstream Bug URL

Time tracking

6h logged

Affects versions

Priority

Created August 22, 2018 at 6:37 AM
Updated March 6, 2024 at 12:55 PM
Resolved December 18, 2018 at 6:51 AM