diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2018-01-12 18:17:55 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2018-01-12 18:17:55 +0100 |
commit | f26192559161143c7c0880cf24c63ced1cf9655e (patch) | |
tree | c2d1b46c6a02ecac0eeae962de854d757c1fb118 /mysql-test/t/query_cache_debug.test | |
parent | 5ea28015d5864bec1e44722bbc7a3d1f2371c85d (diff) | |
download | mariadb-git-bb-5.5-MDEV-14526.tar.gz |
MDEV-14526: MariaDB keeps crashing under load when query_cache_type is changedbb-5.5-MDEV-14526
The problem was in such scenatio:
T1 - starts geristering query and locked QC
T2 - starts disabling QC and wait for UNLOCK
T1 - unlock QC
T2 - disable QC and destroy sugnals without waitiung for query unlock
T1 a) - not yet unlocked query in qc and crach on attempt to unlock because QC signals are destroyed
b) if above was done before distruction, it execute end_of results first time
it exit on after try_lock which see QC disables and return TRUE.
But it do not reset query_cache_tls->first_query_block which lead to
second call of end_of_result when diagnostic arena has already inapropriate staus (not is_eof()).
Fix is:
1) wait for all queries unlocked before destroing them by locking and unlockin
2) remove query_cache_tls->first_query_block if QC disabled
Diffstat (limited to 'mysql-test/t/query_cache_debug.test')
-rw-r--r-- | mysql-test/t/query_cache_debug.test | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/mysql-test/t/query_cache_debug.test b/mysql-test/t/query_cache_debug.test index 854af85f3fb..51df5ce48da 100644 --- a/mysql-test/t/query_cache_debug.test +++ b/mysql-test/t/query_cache_debug.test @@ -319,3 +319,55 @@ RESET QUERY CACHE; DROP TABLE t1; SET GLOBAL query_cache_size= DEFAULT; SET GLOBAL query_cache_type= DEFAULT; + +--echo # +--echo # MDEV-14526: MariaDB keeps crashing under load when +--echo # query_cache_type is changed +--echo # + +CREATE TABLE t1 ( + `id` int(10) NOT NULL AUTO_INCREMENT, + `k` int(10) NOT NULL default '0', + PRIMARY KEY (`id`)) +ENGINE=MyISAM; + +INSERT IGNORE INTO t1 VALUES + (NULL,1),(NULL,8),(NULL,NULL),(NULL,NULL),(NULL,4),(NULL,9),(NULL,7), + (NULL,3),(NULL,NULL),(NULL,2),(NULL,3),(NULL,NULL),(NULL,2),(NULL,7), + (NULL,1),(NULL,2),(NULL,4),(NULL,NULL),(NULL,1),(NULL,1),(NULL,4); + +SET GLOBAL query_cache_size= 1024*1024; +SET GLOBAL query_cache_type= 1; + +--connect (con2,localhost,root,,test) +--connect (con1,localhost,root,,test) +set debug_sync="wait_in_query_cache_store_query SIGNAL parked WAIT_FOR go"; +--send + + SELECT DISTINCT id FROM t1 WHERE id BETWEEN 5603 AND 16218 ORDER BY k; + +--connection default + +set debug_sync="now WAIT_FOR parked"; +--connection con2 +--send + SET GLOBAL query_cache_type= 0; + +--connection default +set debug_sync="now SIGNAL go"; + +--connection con1 +--reap +--connection con2 +--reap + +# Cleanup +--disconnect con1 +--disconnect con2 +--connection default +set debug_sync= 'RESET'; +DROP TABLE t1; +SEt GLOBAL query_cache_size= DEFAULT; +SEt GLOBAL query_cache_type= DEFAULT; + +--echo # End of 5.5 tests |