Bug #95113 Shorten LOG table MDL scope
Submitted: 24 Apr 2019 13:03 Modified: 29 Apr 2019 6:45
Reporter: Zhao Jianwei Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Locking Severity:S4 (Feature request)
Version:8.0.15 OS:Any
Assigned to: CPU Architecture:Any

[24 Apr 2019 13:03] Zhao Jianwei
Description:
Hi, guys

Oftenly we collect slow_log/general_log and then truncate it,  but TRUNCATE TABLE is occasionly blocked by SELECT statement which is not commit.

Log table like Slow_log/General_log didn't generate binary log, so the MDL scope hold by statement on Log table can be shorten to MDL_STATEMENT from MDL_TRANSACTION, it can decrease the possibility of MDL blocking when truncate these tables.

How to repeat:
See x.patch test case.

Suggested fix:
See x.patch
[24 Apr 2019 13:05] Zhao Jianwei
patch contribution

Attachment: x.patch (application/octet-stream, text), 2.06 KiB.

[29 Apr 2019 6:45] MySQL Verification Team
Hello Zhao Jianwei,

Thank you for the feature request, supplying patch along with the report.
Please note that in order to submit contributions you must first sign the Oracle Contribution Agreement (OCA). More details are described in "Contributions" tab, please ensure to re-send the patch via that tab. Otherwise we would not be able to accept it.

regards,
Umesh