[MDEV-14638] Replace trx_sys_t::rw_trx_set with LF_HASH Created: 2017-12-13  Updated: 2021-03-18  Resolved: 2018-01-11

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

Type: Task Priority: Major
Reporter: Sergey Vojtovich Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-15658 Assertion `!expl_lock || expl_lock->t... Closed
causes MDEV-22680 InnoDB trx_sys improvements Open
causes MDEV-25125 Draft: InnoDB: Assertion failure in ... Closed
Relates
relates to MDEV-23510 Crash in my_strnncoll_binary while ru... Closed
relates to MDEV-11215 Several locks taken to same record in... Stalled
Epic Link: arm64 optimization
Sprint: 5.5.59

 Description   

trx_sys_t::rw_trx_set implemented as std::set, which does a few quite expensive operations under trx_sys_t::mutex protection. E.g. malloc/free when adding/removing elements.

Aim of this task is to reduce trx_sys_t::mutex contention by replacing rw_trx_set with LF_HASH.



 Comments   
Comment by Sergey Vojtovich [ 2017-12-20 ]

marko, please review top 3 patches here: https://github.com/MariaDB/server/commits/bb-10.3-MDEV14638

Comment by Sergey Vojtovich [ 2017-12-20 ]

4 patches now: optimised one of find() calls.

Remaining find() calls worth optimising:

storage/innobase/lock/lock0lock.cc:             trx = trx_sys->rw_trx_hash.find(trx_id, true);
storage/innobase/row/row0vers.cc:       trx_t*  trx = trx_sys->rw_trx_hash.find(trx_id, true);
storage/innobase/row/row0vers.cc:               version_trx = trx_sys->rw_trx_hash.find(version_trx_id);
storage/innobase/btr/btr0cur.cc:            && !trx_sys->rw_trx_hash.find(row_get_rec_trx_id(rec, index,

Comment by Sergey Vojtovich [ 2017-12-20 ]

danblack, you might be interested in this cool thing as well.

Comment by Daniel Black [ 2017-12-20 ]

Ooh, shiny, thanks svoj, I'll take a look.

Comment by Sergey Vojtovich [ 2017-12-23 ]

I saved tree with Marko's commits to https://github.com/MariaDB/server/commits/bb-10.3-MDEV14638-1
Also I integrated some of suggestions and did force push to https://github.com/MariaDB/server/commits/bb-10.3-MDEV14638

Comment by Marko Mäkelä [ 2018-01-09 ]

Very good. Please address my review comments 1, 2 and submit revised commits for final approval.

Comment by Marko Mäkelä [ 2018-01-10 ]

OK to push with the fix-up, after addressing my remaining minor comments.

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