/usr/local/mariadb-10.3.5-linux-x86_64/bin/mysqltest: Error on delete of '/usr/local/mariadb-10.3.5-linux-x86_64/mysql-test/var/4/tmp/table_flags/ibtmp1' (Errcode: 2 "No such file or directory")
The problem appears to be that slow shutdown is not always running purge to completion. This can be repeated more easily by applying the patch from the description of MDEV-13697 to the test, and adjusting the result.
When it fails, in the failed run there will be messages
?func: purge: reset DB_TRX_ID=0x…
corresponding to the DB_TRX_ID that are shown in the result difference.
These messages were issued after server restart and not during the slow shutdown, as purge is supposed to be run.
This can be repeated with different values of -mysqld=-innodb-purge-threads=1 to 32 (the default is 4).
If I change the test to avoid restart (use wait_all_purged.inc and FLUSH TABLE t1 FOR EXPORT) instead of performing the slow shutdown, it does not fail for me.
Marko Mäkelä
added a comment - The problem appears to be that slow shutdown is not always running purge to completion. This can be repeated more easily by applying the patch from the description of MDEV-13697 to the test, and adjusting the result.
./mtr --mysqld=--debug=d,purge --mem --parallel=4 --repeat=10 innodb.dml_purge,4k{,,,}
When it fails, in the failed run there will be messages
?func: purge: reset DB_TRX_ID=0x…
corresponding to the DB_TRX_ID that are shown in the result difference.
These messages were issued after server restart and not during the slow shutdown, as purge is supposed to be run.
This can be repeated with different values of - mysqld= -innodb-purge-threads=1 to 32 (the default is 4).
If I change the test to avoid restart (use wait_all_purged.inc and FLUSH TABLE t1 FOR EXPORT ) instead of performing the slow shutdown, it does not fail for me.
If we happened to have n_purged==0 while some transaction was still active, and then that transaction was added to the history list, we would prematurely stop the purge. It is more appropriate to first check for trx_sys.any_active_transactions() == 0 (that count can only decrease during shutdown) and then for trx_sys.history_size() == 0 (that count typically decreases, but can increase when the remaining active transactions are committed or rolled back). It does not make any sense to check n_purged at all.
Marko Mäkelä
added a comment - The problem turns out to be an incorrect check:
@@ -2463,12 +2459,7 @@ srv_purge_should_exit(ulint n_purged)
return(true);
}
/* Slow shutdown was requested. */
- if (n_purged) {
- /* The previous round still did some work. */
- return(false);
- }
- /* Exit if there are no active transactions to roll back. */
- return(trx_sys.any_active_transactions() == 0);
+ return !trx_sys.any_active_transactions() && !trx_sys.history_size();
}
/*********************************************************************//**
If we happened to have n_purged==0 while some transaction was still active, and then that transaction was added to the history list, we would prematurely stop the purge. It is more appropriate to first check for trx_sys.any_active_transactions() == 0 (that count can only decrease during shutdown) and then for trx_sys.history_size() == 0 (that count typically decreases, but can increase when the remaining active transactions are committed or rolled back). It does not make any sense to check n_purged at all.
} while (n_pages_purged > 0 && !srv_fast_shutdown);
I think that it suffices to fix this in MariaDB 10.3 only. Thanks to MDEV-12289, MariaDB can upgrade from older versions without a slow shutdown.
Marko Mäkelä
added a comment - The issue exists already in MariaDB 5.5:
do {
n_pages_purged = trx_purge(srv_purge_batch_size);
n_total_purged += n_pages_purged;
} while (n_pages_purged > 0 && !srv_fast_shutdown);
I think that it suffices to fix this in MariaDB 10.3 only. Thanks to MDEV-12289 , MariaDB can upgrade from older versions without a slow shutdown.
The issue exists already in MySQL 3.23.49 (the first InnoDB version that I have access to). In the function srv_master_thread(), there are two loops that simply wait for n_pages_purged==0, without first waiting for the number of active transactions to reach 0.
Marko Mäkelä
added a comment - The issue exists already in MySQL 3.23.49 (the first InnoDB version that I have access to). In the function srv_master_thread() , there are two loops that simply wait for n_pages_purged==0 , without first waiting for the number of active transactions to reach 0.
People
Marko Mäkelä
Alice Sherepa
Votes:
0Vote for this issue
Watchers:
4Start 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":1174.1000000238419,"ttfb":232.5,"pageVisibility":"visible","entityId":62787,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"7bb1c418-5591-4336-9241-592211fd33c8","navigationType":0,"readyForUser":1257.1000000238419,"redirectCount":0,"resourceLoadedEnd":936.3999999761581,"resourceLoadedStart":240.10000002384186,"resourceTiming":[{"duration":260,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":240.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":240.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":500.10000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":260,"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":240.39999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":240.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":500.39999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":447,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":240.60000002384186,"connectEnd":500.7999999523163,"connectStart":500.7999999523163,"domainLookupEnd":500.7999999523163,"domainLookupStart":500.7999999523163,"fetchStart":240.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":501.2000000476837,"responseEnd":687.6000000238419,"responseStart":517.2000000476837,"secureConnectionStart":500.7999999523163},{"duration":591.2000000476837,"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":240.79999995231628,"connectEnd":240.79999995231628,"connectStart":240.79999995231628,"domainLookupEnd":240.79999995231628,"domainLookupStart":240.79999995231628,"fetchStart":240.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":501.39999997615814,"responseEnd":832,"responseStart":518.3999999761581,"secureConnectionStart":240.79999995231628},{"duration":296.60000002384186,"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":241,"connectEnd":241,"connectStart":241,"domainLookupEnd":241,"domainLookupStart":241,"fetchStart":241,"redirectEnd":0,"redirectStart":0,"requestStart":505,"responseEnd":537.6000000238419,"responseStart":532.2000000476837,"secureConnectionStart":241},{"duration":297.2999999523163,"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":241.20000004768372,"connectEnd":241.20000004768372,"connectStart":241.20000004768372,"domainLookupEnd":241.20000004768372,"domainLookupStart":241.20000004768372,"fetchStart":241.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":505.2000000476837,"responseEnd":538.5,"responseStart":533.7000000476837,"secureConnectionStart":241.20000004768372},{"duration":296.60000002384186,"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":241.29999995231628,"connectEnd":241.29999995231628,"connectStart":241.29999995231628,"domainLookupEnd":241.29999995231628,"domainLookupStart":241.29999995231628,"fetchStart":241.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":505.2999999523163,"responseEnd":537.8999999761581,"responseStart":532.8999999761581,"secureConnectionStart":241.29999995231628},{"duration":262.5,"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":241.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":241.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":504,"responseStart":0,"secureConnectionStart":0},{"duration":297.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":241.70000004768372,"connectEnd":241.70000004768372,"connectStart":241.70000004768372,"domainLookupEnd":241.70000004768372,"domainLookupStart":241.70000004768372,"fetchStart":241.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":506.5,"responseEnd":539.2000000476837,"responseStart":536.3999999761581,"secureConnectionStart":241.70000004768372},{"duration":263,"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":241.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":241.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":504.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":299.2000000476837,"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":241.89999997615814,"connectEnd":241.89999997615814,"connectStart":241.89999997615814,"domainLookupEnd":241.89999997615814,"domainLookupStart":241.89999997615814,"fetchStart":241.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":506.89999997615814,"responseEnd":541.1000000238419,"responseStart":539.5,"secureConnectionStart":241.89999997615814},{"duration":587.7000000476837,"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":262.7999999523163,"connectEnd":262.7999999523163,"connectStart":262.7999999523163,"domainLookupEnd":262.7999999523163,"domainLookupStart":262.7999999523163,"fetchStart":262.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":784.3999999761581,"responseEnd":850.5,"responseStart":847,"secureConnectionStart":262.7999999523163},{"duration":672.1999999284744,"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":264.2000000476837,"connectEnd":264.2000000476837,"connectStart":264.2000000476837,"domainLookupEnd":264.2000000476837,"domainLookupStart":264.2000000476837,"fetchStart":264.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":922.1000000238419,"responseEnd":936.3999999761581,"responseStart":935.6000000238419,"secureConnectionStart":264.2000000476837},{"duration":152,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":812.8999999761581,"connectEnd":812.8999999761581,"connectStart":812.8999999761581,"domainLookupEnd":812.8999999761581,"domainLookupStart":812.8999999761581,"fetchStart":812.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":926.5,"responseEnd":964.8999999761581,"responseStart":964.1000000238419,"secureConnectionStart":812.8999999761581},{"duration":312.89999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1074.6000000238419,"connectEnd":1074.6000000238419,"connectStart":1074.6000000238419,"domainLookupEnd":1074.6000000238419,"domainLookupStart":1074.6000000238419,"fetchStart":1074.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":1348.7999999523163,"responseEnd":1387.5,"responseStart":1386.2999999523163,"secureConnectionStart":1074.6000000238419}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":45,"responseStart":232,"responseEnd":263,"domLoading":236,"domInteractive":1336,"domContentLoadedEventStart":1336,"domContentLoadedEventEnd":1396,"domComplete":2575,"loadEventStart":2575,"loadEventEnd":2576,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1303.2000000476837},{"name":"bigPipe.sidebar-id.end","time":1304},{"name":"bigPipe.activity-panel-pipe-id.start","time":1304.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.end","time":1307.6000000238419},{"name":"activityTabFullyLoaded","time":1412.6000000238419}],"measures":[],"correlationId":"5970389acbb33e","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":116,"dbReadsTimeInMs":21,"dbConnsTimeInMs":31,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Also the test innodb.table_flags can occasionally fail due to the same problem:
CURRENT_TEST: innodb.table_flags
/usr/local/mariadb-10.3.5-linux-x86_64/bin/mysqltest: Error on delete of '/usr/local/mariadb-10.3.5-linux-x86_64/mysql-test/var/4/tmp/table_flags/ibtmp1' (Errcode: 2 "No such file or directory")
--- /usr/local/mariadb-10.3.5-linux-x86_64/mysql-test/suite/innodb/r/table_flags.result 2018-02-07 17:51:05.000000000 +0200
+++ /usr/local/mariadb-10.3.5-linux-x86_64/mysql-test/suite/innodb/r/table_flags.reject 2018-02-08 02:06:12.954068170 +0200
@@ -72,8 +72,8 @@
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000002)
header=0x000048150310 (NAME='test/td',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
+ DB_TRX_ID=0x00000000000b,
+ DB_ROLL_PTR=0x85000001390110,
ID=0x0000000000000012,
N_COLS=0x80000001,
TYPE=0x00000021,
@@ -82,8 +82,8 @@
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000003)
header=0x000058150200 (NAME='test/tp',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
+ DB_TRX_ID=0x00000000000f,
+ DB_ROLL_PTR=0x870000013b0110,
ID=0x0000000000000014,
N_COLS=0x80000001,
TYPE=0x000009a1,
@@ -102,8 +102,8 @@
CLUSTER_NAME=NULL(0 bytes),
SPACE=0x00000001)
header=0x000050150074 (NAME='test/tz',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
+ DB_TRX_ID=0x00000000000d,
+ DB_ROLL_PTR=0x860000013a0110,
ID=0x0000000000000013,
N_COLS=0x80000001,
TYPE=0x00000023,
mysqltest: Result content mismatch