LevelDB storage engine (MDEV-3841)

[MDEV-4059] LevelDB: query waiting for a lock cannot be killed until query timeout exceeded Created: 2013-01-16  Updated: 2013-02-06  Resolved: 2013-02-06

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

Type: Technical task Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: leveldb

Issue Links:
Relates

 Description   

One connection locked a row, another connection attempts to update the row and starts waiting for the lock. Killing the waiting query has no effect until the wait timeout is exceeded, and only after that the query ends with 'execution interrupted' (rather than 'timeout exceeded').

In the test below we execute the described scenario with leveldb_lock_wait_timeout set to 5. The connection which killed the query waits for 1 second and then checks the processlist – the query is still there, and the state is 'updating', not 'killed'. When the query ends, we can see from now() values that it took full 5 seconds.

For InnoDB it works as expected, the query gets killed.

Test output:

create table t1 (pk int primary key, a int) engine=LevelDB;
insert into t1 values (1,10),(2,20);
begin;
update t1 set a = 100 where pk = 1;
connect  con1,localhost,root,,;
set leveldb_lock_wait_timeout=5;
select now();
now()
2013-01-16 17:44:47
update t1 set a = 1000 where pk = 1;;
connect  con2,localhost,root,,;
kill query 3;
show processlist;
Id      User    Host    db      Command Time    State   Info
4       root    localhost       test    Query   0       init    show processlist
3       root    localhost       test    Query   1       updating        update t1 set a = 1000 where pk = 1
2       root    localhost       test    Sleep   1               NULL
connection con1;
ERROR 70100: Query execution was interrupted
select now();
now()
2013-01-16 17:44:52
connection default;
commit;

Test case:

--enable_connect_log
 
create table t1 (pk int primary key, a int) engine=LevelDB;
insert into t1 values (1,10),(2,20);
begin;
update t1 set a = 100 where pk = 1;
 
--connect (con1,localhost,root,,)
--let $con1_id = `SELECT CONNECTION_ID()`
set leveldb_lock_wait_timeout=5;
select now();
--send update t1 set a = 1000 where pk = 1;
 
--connect (con2,localhost,root,,)
eval kill query $con1_id;
--sleep 1
show processlist;
 
--connection con1
--error ER_QUERY_INTERRUPTED
--reap
select now();
 
--connection default
commit;
 

revision-id: psergey@askmonty.org-20130115181447-1jfr200qcuqzp1sr
revno: 4495
branch-nick: mysql-5.6-leveldb



 Comments   
Comment by Elena Stepanova [ 2013-02-06 ]

Reproducible on
revision-id: psergey@askmonty.org-20130201180328-ocmbh9uvcoedmihp
revno: 4591
branch-nick: mysql-5.6-leveldb

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