With MariaDB 10.6 ( no matter of the subversion but tested mostly with 10.6.10 ) when particular query cache is present you are unable to drop database.
You will need the files all.sql and source_db_schema.sql which are attached to this task.
Then just execute from bash console:
mysql -e "create database source_db"
mysql source_db < source_db_schema.sql
mysql -e 'RESET QUERY CACHE';
mysql -e "create database destination_db" ; mysqldump source_db | mysql destination_db
mysql 'source_db' -e "select option_name from VbVoptions;" ;
In summary if specific query cache is present, you are unable to drop database and it just hangs (MariaDB uses 100% cpu) and no restart ( without "kill -9" ) can be performed .
Thanks for the report and the test case. Reproducible as described on 10.5+.
A reduced and MTR-ed version:
SET @qcache= @@global.query_cache_type;
SETGLOBAL query_cache_type= 1;
SET query_cache_type= 1;
CREATETABLE t1 (a VARCHAR(8)) ENGINE=MyISAM;
SELECT a FROM test.t1;
CREATEDATABASE db;
USE db;
CREATETABLE t2 (b INT) ENGINE=MyISAM;
CREATETABLE t3 (c INT) ENGINE=MyISAM;
SELECT't2' table_name FROM t2;
SELECT't2' table_name FROM t2
UNIONALL
SELECT't3' table_name FROM t3;
DROPDATABASE db;
# Cleanup
USE test;
DROPTABLE t1;
SETGLOBAL query_cache_type= @qcache;
DROP DATABASE db hangs (loops at high CPU), one of stack traces:
10.5 dca4fc24
#3 0x000055f04f7e908d in DbugMalloc (size=568) at /src/dbug/dbug.c:2071
#4 0x000055f04f7e7143 in PushState (cs=0x606000015fe0) at /src/dbug/dbug.c:1596
#5 0x000055f04f7e12f3 in _db_push_ (control=0x55f0508ff460 "") at /src/dbug/dbug.c:864
#6 0x000055f04f7884ca in safe_mutex_lock (mp=0x62b00006b030, my_flags=0, file=0x55f04f97cd60 "/src/sql/sql_class.h", line=4239) at /src/mysys/thr_mutex.c:236
#7 0x000055f04da0fe9b in inline_mysql_mutex_lock (that=0x62b00006b030, src_file=0x55f04f97cd60 "/src/sql/sql_class.h", src_line=4239) at /src/include/mysql/psi/mysql_thread.h:750
#8 0x000055f04da321a8 in THD::set_killed (this=0x62b000069218, killed_arg=KILL_CONNECTION, killed_errno_arg=0, killed_err_msg_arg=0x0) at /src/sql/sql_class.h:4239
#9 0x000055f04dba9a84 in Query_cache::wreck (this=0x55f051c29f40 <query_cache>, line=867, message=0x55f04fa1c840 "incorrect block type") at /src/sql/sql_cache.cc:4691
#10 0x000055f04db991bc in Query_cache_block::table (this=0x7f88d71f87f8) at /src/sql/sql_cache.cc:867
#11 0x000055f04db9f75e in Query_cache::invalidate (this=0x55f051c29f40 <query_cache>, thd=0x62b000069218, db=0x62b0000382c8 "db") at /src/sql/sql_cache.cc:2380
#12 0x000055f04dbf735b in mysql_rm_db_internal (thd=0x62b000069218, db=0x62b00006e0c8, if_exists=false, silent=false) at /src/sql/sql_db.cc:972
#13 0x000055f04dbf7eb3 in mysql_rm_db (thd=0x62b000069218, db=0x62b00006e0c8, if_exists=false) at /src/sql/sql_db.cc:1103
#14 0x000055f04dcd6ff0 in mysql_execute_command (thd=0x62b000069218) at /src/sql/sql_parse.cc:5241
#15 0x000055f04dce8c53 in mysql_parse (thd=0x62b000069218, rawbuf=0x62b000038238 "DROP DATABASE db", length=16, parser_state=0x7f88d767ec40, is_com_multi=false, is_next_command=false) at /src/sql/sql_parse.cc:8087
#16 0x000055f04dcc1449 in dispatch_command (command=COM_QUERY, thd=0x62b000069218, packet=0x62900024e219 "DROP DATABASE db", packet_length=16, is_com_multi=false, is_next_command=false) at /src/sql/sql_parse.cc:1891
#17 0x000055f04dcbe682 in do_command (thd=0x62b000069218) at /src/sql/sql_parse.cc:1375
#18 0x000055f04e09d7d0 in do_handle_one_connection (connect=0x608000002538, put_in_cache=true) at /src/sql/sql_connect.cc:1416
#19 0x000055f04e09d198 in handle_one_connection (arg=0x6080000024b8) at /src/sql/sql_connect.cc:1318
#20 0x000055f04ebb9b1c in pfs_spawn_thread (arg=0x615000005d18) at /src/storage/perfschema/pfs.cc:2201
#21 0x00007f88e1078ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#22 0x00007f88e0c65aef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
The problem was introduced in 10.5.4 by this commit:
commit dfb41fddf69ccbca89fd322901f2809bc3bcc0e9
Author: Monty
Date: Fri Jun 5 18:55:11 2020 +0300
Make error messages from DROP TABLE and DROP TABLE IF EXISTS consistent
(despite the main line, there were "other things" in that commit).
Elena Stepanova
added a comment - Thanks for the report and the test case. Reproducible as described on 10.5+.
A reduced and MTR-ed version:
SET @qcache= @@ global .query_cache_type;
SET GLOBAL query_cache_type= 1;
SET query_cache_type= 1;
CREATE TABLE t1 (a VARCHAR (8)) ENGINE=MyISAM;
SELECT a FROM test.t1;
CREATE DATABASE db;
USE db;
CREATE TABLE t2 (b INT ) ENGINE=MyISAM;
CREATE TABLE t3 (c INT ) ENGINE=MyISAM;
SELECT 't2' table_name FROM t2;
SELECT 't2' table_name FROM t2
UNION ALL
SELECT 't3' table_name FROM t3;
DROP DATABASE db;
# Cleanup
USE test;
DROP TABLE t1;
SET GLOBAL query_cache_type= @qcache;
DROP DATABASE db hangs (loops at high CPU), one of stack traces:
10.5 dca4fc24
#3 0x000055f04f7e908d in DbugMalloc (size=568) at /src/dbug/dbug.c:2071
#4 0x000055f04f7e7143 in PushState (cs=0x606000015fe0) at /src/dbug/dbug.c:1596
#5 0x000055f04f7e12f3 in _db_push_ (control=0x55f0508ff460 "") at /src/dbug/dbug.c:864
#6 0x000055f04f7884ca in safe_mutex_lock (mp=0x62b00006b030, my_flags=0, file=0x55f04f97cd60 "/src/sql/sql_class.h", line=4239) at /src/mysys/thr_mutex.c:236
#7 0x000055f04da0fe9b in inline_mysql_mutex_lock (that=0x62b00006b030, src_file=0x55f04f97cd60 "/src/sql/sql_class.h", src_line=4239) at /src/include/mysql/psi/mysql_thread.h:750
#8 0x000055f04da321a8 in THD::set_killed (this=0x62b000069218, killed_arg=KILL_CONNECTION, killed_errno_arg=0, killed_err_msg_arg=0x0) at /src/sql/sql_class.h:4239
#9 0x000055f04dba9a84 in Query_cache::wreck (this=0x55f051c29f40 <query_cache>, line=867, message=0x55f04fa1c840 "incorrect block type") at /src/sql/sql_cache.cc:4691
#10 0x000055f04db991bc in Query_cache_block::table (this=0x7f88d71f87f8) at /src/sql/sql_cache.cc:867
#11 0x000055f04db9f75e in Query_cache::invalidate (this=0x55f051c29f40 <query_cache>, thd=0x62b000069218, db=0x62b0000382c8 "db") at /src/sql/sql_cache.cc:2380
#12 0x000055f04dbf735b in mysql_rm_db_internal (thd=0x62b000069218, db=0x62b00006e0c8, if_exists=false, silent=false) at /src/sql/sql_db.cc:972
#13 0x000055f04dbf7eb3 in mysql_rm_db (thd=0x62b000069218, db=0x62b00006e0c8, if_exists=false) at /src/sql/sql_db.cc:1103
#14 0x000055f04dcd6ff0 in mysql_execute_command (thd=0x62b000069218) at /src/sql/sql_parse.cc:5241
#15 0x000055f04dce8c53 in mysql_parse (thd=0x62b000069218, rawbuf=0x62b000038238 "DROP DATABASE db", length=16, parser_state=0x7f88d767ec40, is_com_multi=false, is_next_command=false) at /src/sql/sql_parse.cc:8087
#16 0x000055f04dcc1449 in dispatch_command (command=COM_QUERY, thd=0x62b000069218, packet=0x62900024e219 "DROP DATABASE db", packet_length=16, is_com_multi=false, is_next_command=false) at /src/sql/sql_parse.cc:1891
#17 0x000055f04dcbe682 in do_command (thd=0x62b000069218) at /src/sql/sql_parse.cc:1375
#18 0x000055f04e09d7d0 in do_handle_one_connection (connect=0x608000002538, put_in_cache=true) at /src/sql/sql_connect.cc:1416
#19 0x000055f04e09d198 in handle_one_connection (arg=0x6080000024b8) at /src/sql/sql_connect.cc:1318
#20 0x000055f04ebb9b1c in pfs_spawn_thread (arg=0x615000005d18) at /src/storage/perfschema/pfs.cc:2201
#21 0x00007f88e1078ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#22 0x00007f88e0c65aef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
The problem was introduced in 10.5.4 by this commit:
commit dfb41fddf69ccbca89fd322901f2809bc3bcc0e9
Author: Monty
Date: Fri Jun 5 18:55:11 2020 +0300
Make error messages from DROP TABLE and DROP TABLE IF EXISTS consistent
(despite the main line, there were "other things" in that commit).
I can reproduce the deadlock with Nevens example everytime also with the latest MariaDB 10.6.10.
It is only working if the Query-cache-reset is immediately executed before the drop.
Alex
added a comment - I can reproduce the deadlock with Nevens example everytime also with the latest MariaDB 10.6.10.
It is only working if the Query-cache-reset is immediately executed before the drop.
Related to MDEV-23527 and MDEV-25023 .
Thanks NevenIvanov for the test case, and elenst for the reduction/bisect down to commit to blame. Both helped immensely.
Daniel Black
added a comment - Thanks NevenIvanov for the test case, and elenst for the reduction/bisect down to commit to blame. Both helped immensely.
People
Daniel Black
Neven Ivanov
Votes:
0Vote for this issue
Watchers:
8Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1026.6000000238419,"ttfb":342.80000001192093,"pageVisibility":"visible","entityId":115417,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"232d6b79-101e-474b-98a2-33e112c9d5a9","navigationType":0,"readyForUser":1109.300000011921,"redirectCount":0,"resourceLoadedEnd":1360.6000000238419,"resourceLoadedStart":347.89999997615814,"resourceTiming":[{"duration":171.10000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":347.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":347.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":519,"responseStart":0,"secureConnectionStart":0},{"duration":171.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":348.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":348.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":519.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":215.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":348.19999998807907,"connectEnd":348.19999998807907,"connectStart":348.19999998807907,"domainLookupEnd":348.19999998807907,"domainLookupStart":348.19999998807907,"fetchStart":348.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":348.19999998807907,"responseEnd":563.5,"responseStart":563.5,"secureConnectionStart":348.19999998807907},{"duration":251.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":348.5,"connectEnd":348.5,"connectStart":348.5,"domainLookupEnd":348.5,"domainLookupStart":348.5,"fetchStart":348.5,"redirectEnd":0,"redirectStart":0,"requestStart":348.5,"responseEnd":600.3999999761581,"responseStart":600.3999999761581,"secureConnectionStart":348.5},{"duration":256,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":348.60000002384186,"connectEnd":348.60000002384186,"connectStart":348.60000002384186,"domainLookupEnd":348.60000002384186,"domainLookupStart":348.60000002384186,"fetchStart":348.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":348.60000002384186,"responseEnd":604.6000000238419,"responseStart":604.6000000238419,"secureConnectionStart":348.60000002384186},{"duration":256.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":348.80000001192093,"connectEnd":348.80000001192093,"connectStart":348.80000001192093,"domainLookupEnd":348.80000001192093,"domainLookupStart":348.80000001192093,"fetchStart":348.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":348.80000001192093,"responseEnd":605.1000000238419,"responseStart":605.1000000238419,"secureConnectionStart":348.80000001192093},{"duration":256.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":349.10000002384186,"connectEnd":349.10000002384186,"connectStart":349.10000002384186,"domainLookupEnd":349.10000002384186,"domainLookupStart":349.10000002384186,"fetchStart":349.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":349.10000002384186,"responseEnd":605.5,"responseStart":605.5,"secureConnectionStart":349.10000002384186},{"duration":359.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":349.19999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":349.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":708.6999999880791,"responseStart":0,"secureConnectionStart":0},{"duration":256.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":349.39999997615814,"connectEnd":349.39999997615814,"connectStart":349.39999997615814,"domainLookupEnd":349.39999997615814,"domainLookupStart":349.39999997615814,"fetchStart":349.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":349.39999997615814,"responseEnd":606,"responseStart":606,"secureConnectionStart":349.39999997615814},{"duration":359.30000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":349.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":349.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":708.8000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":257.0999999642372,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":349.60000002384186,"connectEnd":349.60000002384186,"connectStart":349.60000002384186,"domainLookupEnd":349.60000002384186,"domainLookupStart":349.60000002384186,"fetchStart":349.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":349.60000002384186,"responseEnd":606.6999999880791,"responseStart":606.6999999880791,"secureConnectionStart":349.60000002384186},{"duration":976.3000000119209,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":355.19999998807907,"connectEnd":355.19999998807907,"connectStart":355.19999998807907,"domainLookupEnd":355.19999998807907,"domainLookupStart":355.19999998807907,"fetchStart":355.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":355.19999998807907,"responseEnd":1331.5,"responseStart":1331.3999999761581,"secureConnectionStart":355.19999998807907},{"duration":975.1999999880791,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":360.80000001192093,"connectEnd":360.80000001192093,"connectStart":360.80000001192093,"domainLookupEnd":360.80000001192093,"domainLookupStart":360.80000001192093,"fetchStart":360.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":360.80000001192093,"responseEnd":1336,"responseStart":1336,"secureConnectionStart":360.80000001192093},{"duration":158,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":720.3999999761581,"connectEnd":720.3999999761581,"connectStart":720.3999999761581,"domainLookupEnd":720.3999999761581,"domainLookupStart":720.3999999761581,"fetchStart":720.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":720.3999999761581,"responseEnd":878.3999999761581,"responseStart":878.3999999761581,"secureConnectionStart":720.3999999761581},{"duration":380.30000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":980.3000000119209,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":980.3000000119209,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1360.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":361.5999999642372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":981.3000000119209,"connectEnd":981.3000000119209,"connectStart":981.3000000119209,"domainLookupEnd":981.3000000119209,"domainLookupStart":981.3000000119209,"fetchStart":981.3000000119209,"redirectEnd":0,"redirectStart":0,"requestStart":981.3000000119209,"responseEnd":1342.8999999761581,"responseStart":1342.8999999761581,"secureConnectionStart":981.3000000119209},{"duration":352.0999999642372,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1020.1000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1020.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1372.199999988079,"responseStart":0,"secureConnectionStart":0},{"duration":367.80000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":981.8000000119209,"connectEnd":981.8000000119209,"connectStart":981.8000000119209,"domainLookupEnd":981.8000000119209,"domainLookupStart":981.8000000119209,"fetchStart":981.8000000119209,"redirectEnd":0,"redirectStart":0,"requestStart":981.8000000119209,"responseEnd":1349.6000000238419,"responseStart":1349.6000000238419,"secureConnectionStart":981.8000000119209}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":144,"responseStart":343,"responseEnd":361,"domLoading":346,"domInteractive":1408,"domContentLoadedEventStart":1408,"domContentLoadedEventEnd":1458,"domComplete":1780,"loadEventStart":1780,"loadEventEnd":1781,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1337.699999988079},{"name":"bigPipe.sidebar-id.end","time":1338.6000000238419},{"name":"bigPipe.activity-panel-pipe-id.start","time":1338.699999988079},{"name":"bigPipe.activity-panel-pipe-id.end","time":1341.6000000238419},{"name":"activityTabFullyLoaded","time":1476.300000011921}],"measures":[],"correlationId":"f1eb3c789c5fa6","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":127,"dbReadsTimeInMs":23,"dbConnsTimeInMs":33,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Thanks for the report and the test case. Reproducible as described on 10.5+.
A reduced and MTR-ed version:
# Cleanup
DROP DATABASE db hangs (loops at high CPU), one of stack traces:
10.5 dca4fc24
#3 0x000055f04f7e908d in DbugMalloc (size=568) at /src/dbug/dbug.c:2071
#4 0x000055f04f7e7143 in PushState (cs=0x606000015fe0) at /src/dbug/dbug.c:1596
#5 0x000055f04f7e12f3 in _db_push_ (control=0x55f0508ff460 "") at /src/dbug/dbug.c:864
#6 0x000055f04f7884ca in safe_mutex_lock (mp=0x62b00006b030, my_flags=0, file=0x55f04f97cd60 "/src/sql/sql_class.h", line=4239) at /src/mysys/thr_mutex.c:236
#7 0x000055f04da0fe9b in inline_mysql_mutex_lock (that=0x62b00006b030, src_file=0x55f04f97cd60 "/src/sql/sql_class.h", src_line=4239) at /src/include/mysql/psi/mysql_thread.h:750
#8 0x000055f04da321a8 in THD::set_killed (this=0x62b000069218, killed_arg=KILL_CONNECTION, killed_errno_arg=0, killed_err_msg_arg=0x0) at /src/sql/sql_class.h:4239
#9 0x000055f04dba9a84 in Query_cache::wreck (this=0x55f051c29f40 <query_cache>, line=867, message=0x55f04fa1c840 "incorrect block type") at /src/sql/sql_cache.cc:4691
#10 0x000055f04db991bc in Query_cache_block::table (this=0x7f88d71f87f8) at /src/sql/sql_cache.cc:867
#11 0x000055f04db9f75e in Query_cache::invalidate (this=0x55f051c29f40 <query_cache>, thd=0x62b000069218, db=0x62b0000382c8 "db") at /src/sql/sql_cache.cc:2380
#12 0x000055f04dbf735b in mysql_rm_db_internal (thd=0x62b000069218, db=0x62b00006e0c8, if_exists=false, silent=false) at /src/sql/sql_db.cc:972
#13 0x000055f04dbf7eb3 in mysql_rm_db (thd=0x62b000069218, db=0x62b00006e0c8, if_exists=false) at /src/sql/sql_db.cc:1103
#14 0x000055f04dcd6ff0 in mysql_execute_command (thd=0x62b000069218) at /src/sql/sql_parse.cc:5241
#15 0x000055f04dce8c53 in mysql_parse (thd=0x62b000069218, rawbuf=0x62b000038238 "DROP DATABASE db", length=16, parser_state=0x7f88d767ec40, is_com_multi=false, is_next_command=false) at /src/sql/sql_parse.cc:8087
#16 0x000055f04dcc1449 in dispatch_command (command=COM_QUERY, thd=0x62b000069218, packet=0x62900024e219 "DROP DATABASE db", packet_length=16, is_com_multi=false, is_next_command=false) at /src/sql/sql_parse.cc:1891
#17 0x000055f04dcbe682 in do_command (thd=0x62b000069218) at /src/sql/sql_parse.cc:1375
#18 0x000055f04e09d7d0 in do_handle_one_connection (connect=0x608000002538, put_in_cache=true) at /src/sql/sql_connect.cc:1416
#19 0x000055f04e09d198 in handle_one_connection (arg=0x6080000024b8) at /src/sql/sql_connect.cc:1318
#20 0x000055f04ebb9b1c in pfs_spawn_thread (arg=0x615000005d18) at /src/storage/perfschema/pfs.cc:2201
#21 0x00007f88e1078ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#22 0x00007f88e0c65aef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
The problem was introduced in 10.5.4 by this commit:
commit dfb41fddf69ccbca89fd322901f2809bc3bcc0e9
Author: Monty
Date: Fri Jun 5 18:55:11 2020 +0300
Make error messages from DROP TABLE and DROP TABLE IF EXISTS consistent
(despite the main line, there were "other things" in that commit).