Bug #79631 Remove support for SE latch holding across SE calls
Submitted: 14 Dec 2015 10:37 Modified: 13 Apr 2017 12:12
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Storage Engine API Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[14 Dec 2015 10:37] Laurynas Biveinis
Description:
After InnoDB got partitioned AHI latch and related changes to code (bug 77957), there is little value in providing this ability, unless I'm missing something. Removing it will delete some ~500 lines of code from core server and InnoDB, including some on the common query path. Since this would be SE API backwards-incompatible change, 5.8 would be a good target version.

How to repeat:
Code analysis.

Suggested fix:
Remove -
ha_release_temporary_latches
handlerton::release_temporary_latches
btr_cur_search_to_nth_level, btr_pcur_open_with_no_init_func, btr_search_guess_on_hash arg has_search_latch, 
btr_search_check_guess arg can_only_compare_to_cursor_rec, 
btrsea_sync_check class
trx_t::has_search_latch field
INFORMATION_SCHEMA.INNODB_TRX.TRX_ADAPTIVE_HASH_LATCHED and TRX_ADAPTIVE_HASH_TIMEOUT columns, i_s_trx_row_t::trx_has_search_latch and trx_search_latch_timeout fields.
trx_search_latch_release_if_reserved
row_sel_open_pcur arg search_latch_locked
row_sel local var search_latch_locked
[14 Dec 2015 10:38] Laurynas Biveinis
An older patch against 5.7.7 (I can confirm OCA submission if needed) is at https://github.com/laurynas-biveinis/percona-server/commit/dbec10dcbad713ec78a854aee38a53d...
[30 Dec 2015 22:06] MySQL Verification Team
Thank you for the bug report.
[18 Jun 2016 21:35] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0
[13 Apr 2017 12:12] Laurynas Biveinis
This is partially fixed in 8.0.1 by [1], but the cleanup is far from complete - most of the InnoDB internals mentioned above are still here.

[1]:

commit cdfcd31dea7271db4139733b5ae4bd66fddbd545
Author: Marko M<C3><A4>kel<C3><A4> <marko.makela@oracle.com>
Date:   Wed Aug 3 11:28:31 2016 +0200

    Bug#24397872 REMOVE UNNECESSARY METHOD HANDLERTON::RELEASE_TEMPORARY_LATCHES
    
    The sole purpose of handlerton::release_temporary_latches and its wrapper
    function was to release the InnoDB adaptive hash index latch. Now that the
    latch was removed by
    Bug#24300175 IMPROPER CALLS TO TRX_SEARCH_LATCH_RELEASE_IF_RESERVED
    the method has become a no-op and should be removed.
    
    Reviewed-by: Ramil Kalimullin <ramil.kalimullin@oracle.com>