This is an upstream bug introduced in commit 61e2172 "BUG#20136704 --SLAVE-PRESERVE-COMMIT-ORDER CAUSES SLAVE TO DEADLOCK AND BREAK FOR SOME QUERIE"
https://github.com/mysql/mysql-server/commit/61e2172a1885172aec9814fa7ece5a3176547634
This is an upstream bug introduced in commit 61e2172 "BUG#20136704 --SLAVE- PRESERVE- COMMIT- ORDER CAUSES SLAVE TO DEADLOCK AND BREAK FOR SOME QUERIE"
https:/ /github. com/mysql/ mysql-server/ commit/ 61e2172a1885172 aec9814fa7ece5a 3176547634