[MDEV-11377] AliSQL: [Perf] Issue#21 SPLIT LOCK_GRANT LOCK Created: 2016-11-29  Updated: 2017-07-04  Resolved: 2017-07-04

Status: Closed
Project: MariaDB Server
Component/s: Server
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Sergey Vojtovich Assignee: Lixun Peng
Resolution: Won't Do Votes: 0
Labels: None

Epic Link: AliSQL patches

 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



 Comments   
Comment by Sergey Vojtovich [ 2016-11-29 ]

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

Comment by Lixun Peng [ 2017-07-04 ]

svoj I confirmed that MariaDB needn't this patch.

Generated at Thu Feb 08 07:49:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.