Source:
---------
MariaDB 10.2 commit 87af52d7dd733e71fc7a9e39b882a4fd44f41fec
2018-04-16 compiled with debug
My test
SET GLOBAL SQL_MODE = 'traditional';
|
SET GLOBAL wait_timeout = 45;
|
SET GLOBAL lock_wait_timeout = 2;
|
SET GLOBAL innodb_lock_wait_timeout = 1;
|
CREATE TABLE t1 (col1 INT, col4 CHAR(100)) ENGINE = InnoDB ;
|
Now four concurrent sessions start to run one SQL in a loop:
|
Session 1 --- INSERT INTO t1 (col1,col4) VALUES (1,'a') , (1,'a') ;
|
Session 2 --- ALTER TABLE t1 ADD UNIQUE KEY uidx ( col4 );
|
Session 3 --- ALTER TABLE t1 ADD KEY idx ( col1 );
|
The session aborts immediate if hitting error 1702.
|
Session 4 --- ALTER TABLE t1 DROP KEY idx;
|
After some time (you might need several test runs)
- the session 3 which runs ALTER TABLE t1 ADD KEY idx ( col1 )
could harvest the server response ERROR HY000: Index uidx is corrupted
- but the final checks after the four concurrent sessions have disconnected
show that there is no Index uidx and no corruption at all.
SHOW CREATE TABLE t1;
|
Table Create Table
|
t1 CREATE TABLE `t1` (
|
`col1` int(11) DEFAULT NULL,
|
`col4` char(100) DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
SELECT * FROM t1 LIMIT 3;
|
col1 col4
|
1 a
|
1 a
|
1 a
|
CHECK TABLE t1 EXTENDED;
|
Table Op Msg_type Msg_text
|
test.t1 check status OK
|
ANALYZE TABLE t1;
|
Table Op Msg_type Msg_text
|
test.t1 analyze status OK
|
Protocols of the concurrent sessions:
1 --- All INSERTS passed
|
2 --- masses of ERROR 23000: Duplicate entry 'a' for key 'uidx'
|
3 --- One ERROR HY000: Index uidx is corrupted
|
4 --- masses of ERROR 42000: Can't DROP INDEX `idx`; check that it exists
|
IMHO the bug itself isn't that important because
- there is no obvious damage to the table or indexes
- running concurrent DDL on the same table is extreme unlikely
but the error message from the server is in two points ugly
1. A user might assume that something around his table is rotten, get in panic
and either waste time with DDL or restore backups in order to fix something
or try the same, but make an error and introduce by that damages
2. ALTER TABLE t1 ADD KEY idx ( col1 ) harvesting an error message
referring to an index with different name (uidx) looks very strange.
{"report":{"fcp":2970.699999809265,"ttfb":970,"pageVisibility":"visible","entityId":66872,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"fb4c2f05-10af-40e1-8906-9ee793268c33","navigationType":0,"readyForUser":3056.199999809265,"redirectCount":0,"resourceLoadedEnd":5110.099999904633,"resourceLoadedStart":976.5,"resourceTiming":[{"duration":1427.4000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":976.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":976.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2403.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":1428,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":976.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":976.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2404.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":1480.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":977,"connectEnd":977,"connectStart":977,"domainLookupEnd":977,"domainLookupStart":977,"fetchStart":977,"redirectEnd":0,"redirectStart":0,"requestStart":977,"responseEnd":2457.300000190735,"responseStart":2457.300000190735,"secureConnectionStart":977},{"duration":1557,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":977.1999998092651,"connectEnd":977.1999998092651,"connectStart":977.1999998092651,"domainLookupEnd":977.1999998092651,"domainLookupStart":977.1999998092651,"fetchStart":977.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":977.1999998092651,"responseEnd":2534.199999809265,"responseStart":2534.199999809265,"secureConnectionStart":977.1999998092651},{"duration":1582.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":977.5,"connectEnd":977.5,"connectStart":977.5,"domainLookupEnd":977.5,"domainLookupStart":977.5,"fetchStart":977.5,"redirectEnd":0,"redirectStart":0,"requestStart":977.5,"responseEnd":2559.9000000953674,"responseStart":2559.9000000953674,"secureConnectionStart":977.5},{"duration":1582.8000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":977.5999999046326,"connectEnd":977.5999999046326,"connectStart":977.5999999046326,"domainLookupEnd":977.5999999046326,"domainLookupStart":977.5999999046326,"fetchStart":977.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":977.5999999046326,"responseEnd":2560.4000000953674,"responseStart":2560.4000000953674,"secureConnectionStart":977.5999999046326},{"duration":1583,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":977.8000001907349,"connectEnd":977.8000001907349,"connectStart":977.8000001907349,"domainLookupEnd":977.8000001907349,"domainLookupStart":977.8000001907349,"fetchStart":977.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":977.8000001907349,"responseEnd":2560.800000190735,"responseStart":2560.800000190735,"secureConnectionStart":977.8000001907349},{"duration":1631.4000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":977.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":977.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2609.300000190735,"responseStart":0,"secureConnectionStart":0},{"duration":1583.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":978,"connectEnd":978,"connectStart":978,"domainLookupEnd":978,"domainLookupStart":978,"fetchStart":978,"redirectEnd":0,"redirectStart":0,"requestStart":978,"responseEnd":2561.300000190735,"responseStart":2561.300000190735,"secureConnectionStart":978},{"duration":1631.3000001907349,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":978.1999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":978.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2609.5,"responseStart":0,"secureConnectionStart":0},{"duration":1583.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":978.4000000953674,"connectEnd":978.4000000953674,"connectStart":978.4000000953674,"domainLookupEnd":978.4000000953674,"domainLookupStart":978.4000000953674,"fetchStart":978.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":978.4000000953674,"responseEnd":2562,"responseStart":2562,"secureConnectionStart":978.4000000953674},{"duration":4126.800000190735,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":979.1999998092651,"connectEnd":979.1999998092651,"connectStart":979.1999998092651,"domainLookupEnd":979.1999998092651,"domainLookupStart":979.1999998092651,"fetchStart":979.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":979.1999998092651,"responseEnd":5106,"responseStart":5105.900000095367,"secureConnectionStart":979.1999998092651},{"duration":4130.799999713898,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":979.3000001907349,"connectEnd":979.3000001907349,"connectStart":979.3000001907349,"domainLookupEnd":979.3000001907349,"domainLookupStart":979.3000001907349,"fetchStart":979.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":979.3000001907349,"responseEnd":5110.099999904633,"responseStart":5110.099999904633,"secureConnectionStart":979.3000001907349},{"duration":2130.800000190735,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":2641.5999999046326,"connectEnd":2641.5999999046326,"connectStart":2641.5999999046326,"domainLookupEnd":2641.5999999046326,"domainLookupStart":2641.5999999046326,"fetchStart":2641.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":2641.5999999046326,"responseEnd":4772.400000095367,"responseStart":4772.400000095367,"secureConnectionStart":2641.5999999046326},{"duration":2175.4000000953674,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":2963,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2963,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":5138.400000095367,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":800,"responseStart":970,"responseEnd":973,"domLoading":973,"domInteractive":5141,"domContentLoadedEventStart":5141,"domContentLoadedEventEnd":5202,"domComplete":6759,"loadEventStart":6759,"loadEventEnd":6760,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":5112.400000095367},{"name":"bigPipe.sidebar-id.end","time":5113.300000190735},{"name":"bigPipe.activity-panel-pipe-id.start","time":5113.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":5116.199999809265},{"name":"activityTabFullyLoaded","time":5219}],"measures":[],"correlationId":"95eb0f16d9beee","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":105,"dbReadsTimeInMs":10,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
How to use the archive?
------------------------------
cd <tree>/mysql-test
tar xvzf <archive>
Feel free to inspect the files run_mysqltest_prt.* which belong
to my test run.
./mtr --mem ml001
Please just ignore the majority of test output.
.....
CREATE TABLE t1 (col1 INT, col4 CHAR(100)) ENGINE = InnoDB ;
./mysqltest_background.sh 1523893362 1523893422 /mariadb/Source/10.2/mysql-test/var/tmp/my.sql1 1
./mysqltest_background.sh 1523893362 1523893422 /mariadb/Source/10.2/mysql-test/var/tmp/my.sql2 2
./mysqltest_background.sh 1523893362 1523893422 /mariadb/Source/10.2/mysql-test/var/tmp/my.sql3 3
./mysqltest_background.sh 1523893362 1523893422 /mariadb/Source/10.2/mysql-test/var/tmp/my.sql4 4
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`col1` int(11) DEFAULT NULL,
`col4` char(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * FROM t1 LIMIT 3;
col1 col4
1 a
1 a
1 a
CHECK TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 check status OK
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
DROP TABLE t1;
"Was the error pattern found ---- Begin"
ERROR HY000: Index uidx is corrupted <== In case you see that than session replayed
and run_mysqltest_prt.3 shows that error message.
"Was the error pattern found ---- End"
main.ml001 'innodb' [ pass ] 70179
MTR's internal check of the test case 'main.ml001' failed.
....