Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
5.5(EOL) , 10.0(EOL) , 10.1(EOL) , 10.2(EOL) , 10.3(EOL) , 10.4(EOL)
When there is a huge transaction in the undo log, the purge subsystem may get stuck and fail to shut down. This was reproduced with the following on MariaDB 10.4:
diff --git a/mysql-test/suite/innodb/include/innodb-page-compression.inc b/mysql-test/suite/innodb/include/innodb-page-compression.inc
index 0e7ae8cf029..83e5387cdf4 100644
--- a/mysql-test/suite/innodb/include/innodb-page-compression.inc
+++ b/mysql-test/suite/innodb/include/innodb-page-compression.inc
@@ -11,7 +11,7 @@ create table innodb_page_compressed9 (c1 int not null auto_increment primary key
--disable_query_log
begin;
-let $i = 2000;
+let $i = 5000;
while ($i)
{
insert into innodb_normal(b) values(REPEAT('Aa',50));
With this change, the attempt to restart the server would actually time out in the shutdown, like this:
10.4
innodb.innodb-page_compression_snappy 'innodb' [ fail ] Found warnings/errors in server log file!
Test ended at 2019-03-15 11:15:05
line
2019-03-15 11:14:48 0 [Warning] /dev/shm/10.4/sql/mysqld: Thread 5 (user : '') did not exit
2019-03-15 11:14:48 0 [Warning] /dev/shm/10.4/sql/mysqld: Thread 4 (user : '') did not exit
2019-03-15 11:14:48 0 [Warning] /dev/shm/10.4/sql/mysqld: Thread 3 (user : '') did not exit
2019-03-15 11:14:48 0 [Warning] /dev/shm/10.4/sql/mysqld: Thread 2 (user : '') did not exit
2019-03-15 11:14:48 0 [Warning] /dev/shm/10.4/sql/mysqld: Thread 1 (user : '') did not exit
^ Found warnings in /dev/shm/10.4/mysql-test/var/log/mysqld.1.err
ok
The cause is that a purge thread would remain stuck in trx_purge_attach_undo_recs() . Apparently the innodb_purge_batch_size does not work correctly, or the n_pages_handled is not being incremented correctly. In any case, we should exit the loop on non-slow shutdown even before reaching the batch size.
{"report":{"fcp":862.3000001907349,"ttfb":137.80000019073486,"pageVisibility":"visible","entityId":73297,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"a703f262-a294-4bb2-8d66-f3dc9ce69878","navigationType":0,"readyForUser":919.8000001907349,"redirectCount":0,"resourceLoadedEnd":1112.4000000953674,"resourceLoadedStart":145.20000004768372,"resourceTiming":[{"duration":284.7000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":145.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":145.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":429.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":284.5,"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":145.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":145.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":430,"responseStart":0,"secureConnectionStart":0},{"duration":293.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":145.70000004768372,"connectEnd":145.70000004768372,"connectStart":145.70000004768372,"domainLookupEnd":145.70000004768372,"domainLookupStart":145.70000004768372,"fetchStart":145.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":145.70000004768372,"responseEnd":438.80000019073486,"responseStart":438.80000019073486,"secureConnectionStart":145.70000004768372},{"duration":317.39999985694885,"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":145.80000019073486,"connectEnd":145.80000019073486,"connectStart":145.80000019073486,"domainLookupEnd":145.80000019073486,"domainLookupStart":145.80000019073486,"fetchStart":145.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":145.80000019073486,"responseEnd":463.2000000476837,"responseStart":463.2000000476837,"secureConnectionStart":145.80000019073486},{"duration":321.2999999523163,"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":145.90000009536743,"connectEnd":145.90000009536743,"connectStart":145.90000009536743,"domainLookupEnd":145.90000009536743,"domainLookupStart":145.90000009536743,"fetchStart":145.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":145.90000009536743,"responseEnd":467.2000000476837,"responseStart":467.2000000476837,"secureConnectionStart":145.90000009536743},{"duration":323.10000014305115,"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":146,"connectEnd":146,"connectStart":146,"domainLookupEnd":146,"domainLookupStart":146,"fetchStart":146,"redirectEnd":0,"redirectStart":0,"requestStart":146,"responseEnd":469.10000014305115,"responseStart":469.10000014305115,"secureConnectionStart":146},{"duration":325.89999985694885,"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":146.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":146.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":472,"responseStart":0,"secureConnectionStart":0},{"duration":324.5,"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":146.10000014305115,"connectEnd":146.10000014305115,"connectStart":146.10000014305115,"domainLookupEnd":146.10000014305115,"domainLookupStart":146.10000014305115,"fetchStart":146.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":146.10000014305115,"responseEnd":470.60000014305115,"responseStart":470.60000014305115,"secureConnectionStart":146.10000014305115},{"duration":325.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":146.30000019073486,"connectEnd":146.30000019073486,"connectStart":146.30000019073486,"domainLookupEnd":146.30000019073486,"domainLookupStart":146.30000019073486,"fetchStart":146.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":146.30000019073486,"responseEnd":472.10000014305115,"responseStart":472.10000014305115,"secureConnectionStart":146.30000019073486},{"duration":326.90000009536743,"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":146.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":146.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":473.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":327,"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":146.5,"connectEnd":146.5,"connectStart":146.5,"domainLookupEnd":146.5,"domainLookupStart":146.5,"fetchStart":146.5,"redirectEnd":0,"redirectStart":0,"requestStart":146.5,"responseEnd":473.5,"responseStart":473.5,"secureConnectionStart":146.5},{"duration":592.7999999523163,"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":147.30000019073486,"connectEnd":147.30000019073486,"connectStart":147.30000019073486,"domainLookupEnd":147.30000019073486,"domainLookupStart":147.30000019073486,"fetchStart":147.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":147.30000019073486,"responseEnd":740.1000001430511,"responseStart":740.1000001430511,"secureConnectionStart":147.30000019073486},{"duration":965,"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":147.40000009536743,"connectEnd":147.40000009536743,"connectStart":147.40000009536743,"domainLookupEnd":147.40000009536743,"domainLookupStart":147.40000009536743,"fetchStart":147.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":147.40000009536743,"responseEnd":1112.4000000953674,"responseStart":1112.4000000953674,"secureConnectionStart":147.40000009536743},{"duration":444.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":665.6000001430511,"connectEnd":665.6000001430511,"connectStart":665.6000001430511,"domainLookupEnd":665.6000001430511,"domainLookupStart":665.6000001430511,"fetchStart":665.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":665.6000001430511,"responseEnd":1110.2000000476837,"responseStart":1110.2000000476837,"secureConnectionStart":665.6000001430511},{"duration":277.7000000476837,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":837.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":837.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1115.6000001430511,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":15,"responseStart":137,"responseEnd":139,"domLoading":141,"domInteractive":1135,"domContentLoadedEventStart":1135,"domContentLoadedEventEnd":1169,"domComplete":1997,"loadEventStart":1997,"loadEventEnd":1999,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1119.5},{"name":"bigPipe.sidebar-id.end","time":1120.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1120.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1122.6000001430511},{"name":"activityTabFullyLoaded","time":1174.7000000476837}],"measures":[],"correlationId":"6c93d1109b80e9","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":69,"dbReadsTimeInMs":12,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}