[MDEV-3002] LP:711565 - Index Condition Pushdown can make a thread hold MyISAM locks as well as be unKILLable for long time Created: 2011-02-01  Updated: 2012-10-04  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Sergei Petrunia Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug711565.xml    

 Description   

When Index Condition Pushdown is employed, a single index lookup call like handler->index_read(lookup_tuple,...) can potentially enumerate lots (e.g. hundred of thousands) of index records before it finds one that satisfies the pushed index condition.

The problems are:
P1: MyISAM/Maria hold locks while enumerating those records, which means that one long query may stall others.
P2: For all storage engines: the state of thd->killed is not checked. This means that if one decides to kill the query (with KILL <thread_id> statement), it may take a very long time before the query is actually killed.

There is no testcase: Monty has found this out from the code (and provided a patch to address a problem with mi_rkey())



 Comments   
Comment by Sergei Petrunia [ 2011-02-01 ]

Re: Index Condition Pushdown can make a thread hold MyISAM locks as well as be unKILLable for long time
Testcase note: making a mysql-test-run compatible testcase is difficult because "artificially long-running" predicates like SLEEP() actually check thd->killed. One has to use "naturally long-running" predicates, which still take fractions of second, so one also needs tables with lots of rows to observe that the query is not affected by KILL statement.

Comment by Sergei Petrunia [ 2011-06-16 ]

Re: Index Condition Pushdown can make a thread hold MyISAM locks as well as be unKILLable for long time
The fix has been pushed several months ago (revision-id: monty@askmonty.org-20110218154359-vowf21p5mcjhc68y). Updating the bug status.

Comment by Rasmus Johansson (Inactive) [ 2011-06-16 ]

Launchpad bug id: 711565

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