[MDEV-22523] index->rtr_ssn.mutex is wasting memory Created: 2020-05-11  Updated: 2021-09-30  Resolved: 2020-05-11

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2.2, 10.3.0, 10.4.0, 10.5.0
Fix Version/s: 10.5.4, 10.2.33, 10.3.24, 10.4.14

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

Issue Links:
Blocks
blocks MDEV-22456 Dropping the adaptive hash index may ... Closed

 Description   

As part of the SPATIAL INDEX implementation in InnoDB, dict_index_t was expanded by a rtr_ssn_t field. There are only 3 operations for this field, all protected by rtr_ssn_t::mutex:

  • btr_cur_search_to_nth_level() stores the least significant 32 bits of the 64-bit value that is stored in the index root page. (This would better be done when the table is opened for the very first time.)
  • rtr_get_new_ssn_id() increments the value by 1.
  • rtr_get_current_ssn_id() reads the current value.

All these operations can be implemented equally safely by using atomic memory access operations. (Note: Race conditions do exist in the SPATIAL INDEX code, for example, MDEV-15274 and MDEV-15284.)

The mutex is being unnecessarily allocated not only for SPATIAL INDEX objects, but for all InnoDB dict_index_t objects.


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