Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Won't Do
-
None
Description
Description:
|
------------
|
LOCK_grant is a rwlock:
|
wrlock when modify privileges
|
rdlock when check privileges
|
The fact is that we usually check priv at most scenarios, but has serious conflict.
|
|
Solution:
|
---------
|
So we split the LOCK_grant into an array of rwlock:
|
Require one rdlock when checking priv through thread_id % array_size.
|
Require all wrlock when modify priv.
|
|
It will decrease the rdlock conflict substantially.
|
https://github.com/alibaba/AliSQL/commit/70bb6170ed0a4100b97d325c25d9604b10523197
plinux, Monty should have optimised away locking of LOCK_grant in many scenarios a while ago. Could you check if it works for you?
I believe it was done in this patch: https://github.com/MariaDB/server/commit/d8986fd6c3b69d2970e66684e1d00dd603fc9ab7