Sometimes at nightly cron-jobs doing "mysqloptimize" one of the tables get marked "crashed" and automatic repair fails.
The last one is caused by related bug.
I tried to force the error by stressing the database with inserts/reads during mysqloptimize, but I was unable to get it crashed at the moment. But it happens sometimes at night (when the cron job runs).
The script which consists of
mysqlcheck -s -A
mysqloptimize -s -A
mysqlanalyze -s -A
is running for years without any problem. The problem first occured after update from MariaDB 5.5 to 10.0.19.
If this is relevant: all tables have Aria engine.
I still expect some racing condition - as a "user" I'm not familiar when a table is marked "crashed" - but there must be some condition when some lock, or gathering the lock interfears with this state after lock is removed.
- relates to
-
MDEV-8475
stale .TMM file causes Aria engine to stop serving the table
-
-
Closed
- links to
-
{"report":{"fcp":851.6000000238419,"ttfb":231.89999997615814,"pageVisibility":"visible","entityId":52513,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"bbc16093-af8e-4a26-ab68-a223bd772d74","navigationType":0,"readyForUser":921.3999999761581,"redirectCount":0,"resourceLoadedEnd":585.6000000238419,"resourceLoadedStart":240.89999997615814,"resourceTiming":[{"duration":40.799999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":240.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":240.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":281.6999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":40.699999928474426,"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":241.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":241.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":281.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":212.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":241.29999995231628,"connectEnd":241.29999995231628,"connectStart":241.29999995231628,"domainLookupEnd":241.29999995231628,"domainLookupStart":241.29999995231628,"fetchStart":241.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":287.5,"responseEnd":453.7999999523163,"responseStart":309.89999997615814,"secureConnectionStart":241.29999995231628},{"duration":343.2000000476837,"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":242.39999997615814,"connectEnd":242.39999997615814,"connectStart":242.39999997615814,"domainLookupEnd":242.39999997615814,"domainLookupStart":242.39999997615814,"fetchStart":242.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":287.7999999523163,"responseEnd":585.6000000238419,"responseStart":325.7999999523163,"secureConnectionStart":242.39999997615814},{"duration":70,"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":242.5,"connectEnd":242.5,"connectStart":242.5,"domainLookupEnd":242.5,"domainLookupStart":242.5,"fetchStart":242.5,"redirectEnd":0,"redirectStart":0,"requestStart":288,"responseEnd":312.5,"responseStart":310.6999999284744,"secureConnectionStart":242.5},{"duration":74,"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":242.60000002384186,"connectEnd":242.60000002384186,"connectStart":242.60000002384186,"domainLookupEnd":242.60000002384186,"domainLookupStart":242.60000002384186,"fetchStart":242.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":288.5,"responseEnd":316.60000002384186,"responseStart":312.89999997615814,"secureConnectionStart":242.60000002384186},{"duration":75.30000007152557,"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":242.69999992847443,"connectEnd":242.69999992847443,"connectStart":242.69999992847443,"domainLookupEnd":242.69999992847443,"domainLookupStart":242.69999992847443,"fetchStart":242.69999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":288.60000002384186,"responseEnd":318,"responseStart":313.89999997615814,"secureConnectionStart":242.69999992847443},{"duration":40.200000047683716,"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":242.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":242.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":283,"responseStart":0,"secureConnectionStart":0},{"duration":75.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":242.89999997615814,"connectEnd":242.89999997615814,"connectStart":242.89999997615814,"domainLookupEnd":242.89999997615814,"domainLookupStart":242.89999997615814,"fetchStart":242.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":289.60000002384186,"responseEnd":318.2999999523163,"responseStart":314.5,"secureConnectionStart":242.89999997615814},{"duration":40.89999997615814,"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":243,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":243,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":283.89999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":78.89999997615814,"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":243,"connectEnd":243,"connectStart":243,"domainLookupEnd":243,"domainLookupStart":243,"fetchStart":243,"redirectEnd":0,"redirectStart":0,"requestStart":290,"responseEnd":321.89999997615814,"responseStart":315.1999999284744,"secureConnectionStart":243},{"duration":290.3000000715256,"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":243.79999995231628,"connectEnd":243.79999995231628,"connectStart":243.79999995231628,"domainLookupEnd":243.79999995231628,"domainLookupStart":243.79999995231628,"fetchStart":243.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":343.89999997615814,"responseEnd":534.1000000238419,"responseStart":527.2999999523163,"secureConnectionStart":243.79999995231628},{"duration":291.2000000476837,"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":243.89999997615814,"connectEnd":243.89999997615814,"connectStart":243.89999997615814,"domainLookupEnd":243.89999997615814,"domainLookupStart":243.89999997615814,"fetchStart":243.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":386.6999999284744,"responseEnd":535.1000000238419,"responseStart":530.6000000238419,"secureConnectionStart":243.89999997615814},{"duration":149.30000007152557,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":602.1999999284744,"connectEnd":602.1999999284744,"connectStart":602.1999999284744,"domainLookupEnd":602.1999999284744,"domainLookupStart":602.1999999284744,"fetchStart":602.1999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":719.1999999284744,"responseEnd":751.5,"responseStart":750.5,"secureConnectionStart":602.1999999284744},{"duration":157.60000002384186,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":806.1999999284744,"connectEnd":806.1999999284744,"connectStart":806.1999999284744,"domainLookupEnd":806.1999999284744,"domainLookupStart":806.1999999284744,"fetchStart":806.1999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":929.6000000238419,"responseEnd":963.7999999523163,"responseStart":962.5,"secureConnectionStart":806.1999999284744},{"duration":87.30000007152557,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":842.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":842.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":930.1000000238419,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":73,"responseStart":232,"responseEnd":238,"domLoading":235,"domInteractive":1029,"domContentLoadedEventStart":1029,"domContentLoadedEventEnd":1077,"domComplete":1204,"loadEventStart":1204,"loadEventEnd":1204,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":993.7999999523163},{"name":"bigPipe.sidebar-id.end","time":994.6000000238419},{"name":"bigPipe.activity-panel-pipe-id.start","time":994.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":997.1000000238419},{"name":"activityTabFullyLoaded","time":1099.8999999761581}],"measures":[],"correlationId":"b28ec881e8d66","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":84,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Alessandro, mokraemer, thanks, it seems I am now able to reproduce the problem with a concurrent test.
svoj (or whoever ends up fixing it),
below is the RQG test. Use lp:~elenst/randgen/mariadb-patches to run it.
RQG grammar mdev8571.yy
query_init:
CREATE TABLE IF NOT EXISTS t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=MyISAM; CREATE TABLE IF NOT EXISTS t2 LIKE t1;
query:
REPLACE INTO my_table () VALUES (),();
thread1:
OPTIMIZE TABLE my_table;
my_table:
t1 | t2;
RQG command line
perl ./runall-new.pl --grammar=mdev8571.yy --skip-gendata --threads=2 --queries=100M --duration=120 --mysqld=--wait-timeout=10 --basedir=<10.0 basedir> --vardir=<your vardir>
When the problem is hit, the output looks like this:
# 2015-09-17T03:24:39 [24975] Caching schema metadata for dbi:mysql:host=127.0.0.1:port=18570:user=rqg:database=test
# 2015-09-17T03:24:40 [24975] Starting 2 processes, 100000000 queries each, duration 120 seconds.
# 2015-09-17T03:24:40 [24975] GenTest::ErrorFilter(25178) started
# 2015-09-17T03:24:40 [25179] Started periodic reporting process...
# 2015-09-17T03:24:53 [25182] Query: REPLACE INTO t1 () VALUES (),() failed: 144 Table './test/t1' is marked as crashed and last (automatic?) repair failed
# 2015-09-17T03:24:53 [25182] Query: REPLACE INTO t1 () VALUES (),() failed: 144 Table './test/t1' is marked as crashed and last (automatic?) repair failed
...
It should happen in ~10 seconds after 'Started reporting process' (or in wait_timeout seconds, if one changes the value provided on the command line).
The printed error is not the problem in itself, it's just a side effect (see
MDEV-8475). The real problem is that at some point a TMM file does not get removed.There is no visible problem with OPTIMIZE, so I'm not sure what makes it bypass the file removal, it is to be investigated.
I could not reproduce it on 5.5 (which explains why reporters reported a regression), and it cannot be seen with this test on 10.1 because
MDEV-8475has been fixed there, and the error on REPLACE does not happen, even though the underlying issue might still exist. All in all, I suggest to investigate it on 10.0 and then check if other versions are affected.