SQL ADMIN command execution can cause deadlock

Description

  • ADMIN command like OPTIMIZE etc... can cause complete cluster stall.

  • MySQL may decide to run OPTIMIZE with table re-creation (InnoDB approach).  Table-recreation is internal so the binlog is turned off. Changes done by upstream to fix another bug also caused this binlog turn off action to turn off wsrep_on = off this means OPTIMIZE (DDL statement running under TOI mode) can't brute force abort the local running transaction. This eventually breaks consistency semantics and leads to a deadlock.

Environment

None

Smart Checklist

Activity

Krunal Bauskar September 11, 2019 at 3:37 AM

commit 9721695a7155778743194b4d459fec464bcc67e4
Author: Krunal Bauskar <krunal.bauskar@percona.com>
Date: Tue Sep 10 13:39:28 2019 +0530

  • : SQL ADMIN command execution can cause deadlock

  • ADMIN command like OPTIMIZE etc... can cause complete cluster stall.

  • MySQL may decide to run OPTIMIZE with table re-creation (InnoDB approach).
    Table-recreation is internal so the binlog is turned off. Changes done by
    upstream to fix another bug also caused this binlog turn off action to
    turn off wsrep_on = off this means OPTIMIZE (DDL statement running under
    TOI mode) can't brute force abort the local running transaction.
    This eventually breaks consistency semantics and leads to a deadlock.


Fix:

  • If binlog is turned off before execution of internal DDL statement ensure
    it executes with wsrep_on = 1.

 

Done

Details

Assignee

Reporter

Time tracking

6h 15m logged

Affects versions

Priority

Smart Checklist

Created September 10, 2019 at 7:55 AM
Updated March 6, 2024 at 10:05 PM
Resolved September 11, 2019 at 3:37 AM