[MDEV-16215] Slave SQL thread can't be the victim when deadlock occur Created: 2018-05-18  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Locking, Replication
Affects Version/s: 10.0.35-galera
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: zhang jian Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: lock, replication

Attachments: File improve_thread_priority.diff     File improve_thread_priority.test    

 Description   

When slave support some operations even read-only statement may hold some locks (read will hold locks when isolation level is serializable). So sql thread and worker threads may get deadlock with user threads and have chances to be the victim which would lead to a break between master and slave.

Fix :
We assume each thread have a priority, the priority will decide who is the victim rather than thread's weight and the system threads have high priority(slave threads for now).

In the attach file, a testcase script can reproduce the problem easily and a diff file to show the code to fix it.


Generated at Thu Feb 08 08:27:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.