Originally reported at https://bugs.mysql.com/bug.php?id=88757:????
[5 Dec 2017 10:43] Shane Bester*Description:*
We're seeing this occurring in the wild on 5.7.20:
InnoDB: Assertion failure in thread x in file trx0trx.ic line 213
InnoDB: Failing assertion: !trx->has_search_latch
Look at the code for that:
Releases the search latch if trx has reserved it.
@param[in,out] trx Transaction that may own the AHI latch */
}How to repeat:
Read the code.
The comments are all wrong whenever this is called.
This function releases nothing!
Secondly, the assertion is not needed as far as I can tell,
and it only caused unnecessary downtime on customer's production.Suggested fix:
Make it a debug assertion instead, like:
Add a message to the error log with detailed info (like print out the trx)
so the underlying bug can one day still be solved.
This also affects Percona Server. See
PS-3620 for example.
Please implement required functionality: convert assertion to debug assertion and print additional information into error log file when assertion could happen in release builds. Such as transaction ID, query and everything else which can help to identify source of the error.