[MDEV-11392] AliSQL: [perf] Issue#31 OPTIMIZE CHECK/GRANT OF INNODB TABLE LOCK Created: 2016-11-29  Updated: 2021-02-09  Resolved: 2021-02-09

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: 10.6.0

Type: Task Priority: Major
Reporter: Sergey Vojtovich Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-20612 Improve InnoDB lock_sys scalability Closed
Epic Link: AliSQL patches

 Description   

Description:
------------
Since most workload in production environment is normal DML/SELECT
(this should be very common on most OLTP workload).
So for InnoDB table lock:
1. most time there's only LOCK_IX/LOCK_IS table lock
2. LOCK_S/LOCK_X rarely happen
 
This patch adds some counters to identify if LOCK_S/LOCK_X is granted
and quickly exit function lock_table_other_has_incompatible().
This will improve the performance especially when all DML focused on
the same table.
 
For more deatail, please refer: http://bugs.mysql.com/bug.php?id=72948.
 
This patch also fixes bug#68647 which reduce the overhead of
'SHOW ENGINE INNODB STATUS' and removes some complier warinings.

https://github.com/alibaba/AliSQL/commit/52d847305f4df21b6f7a67f789a1b46223d591ce



 Comments   
Comment by Marko Mäkelä [ 2017-11-17 ]

This looks like a useful contribution.
Can you please rebase this on MariaDB 10.3?

MariaDB already contains the field trx_lock_t::n_rec_locks (added in MySQL 5.7.5) but not the dict_table_t::lock_counter[] that this patch is adding.

Comment by Marko Mäkelä [ 2017-11-17 ]

Also, after backporting, please run some benchmarks to find out how much it improves performance. Maybe the MySQL 5.7 developers decided that adding the trx_lock_t::n_rec_locks is enough.

Comment by Marko Mäkelä [ 2021-02-09 ]

This was fixed as a preparatory step of MDEV-20612.

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