With the merge of the InnoDB changes from MySQL 5.7.9 , MariaDB 10.2.2 inherited a new shutdown hang that was introduced in MySQL 5.7.4 or 5.7.5 .
The hang is caused by a race condition or a lost signal. The purge thread would signal the worker threads only once, and then keep waiting for the workers to exit, without bothering to resignal them.
The following patch fixes the problem:
diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc
index ca647368908..24b27d7462c 100644
--- a/storage/innobase/buf/buf0flu.cc
+++ b/storage/innobase/buf/buf0flu.cc
@@ -2718,25 +2718,6 @@ buf_flush_page_cleaner_init(void)
page_cleaner.is_running = true;
}
-/**
-Close page_cleaner. */
-static
-void
-buf_flush_page_cleaner_close(void)
-{
- ut_ad(!page_cleaner.is_running);
-
- /* waiting for all worker threads exit */
- while (page_cleaner.n_workers) {
- os_thread_sleep(10000);
- }
-
- mutex_destroy(&page_cleaner.mutex);
-
- os_event_destroy(page_cleaner.is_finished);
- os_event_destroy(page_cleaner.is_requested);
-}
-
/**
Requests for all slots to flush all buffer pool instances.
@param min_n wished minimum mumber of blocks flushed
@@ -3438,9 +3419,17 @@ DECLARE_THREAD(buf_flush_page_cleaner_coordinator)(void*)
and no more access to page_cleaner structure by them.
Wakes worker threads up just to make them exit. */
page_cleaner.is_running = false;
- os_event_set(page_cleaner.is_requested);
- buf_flush_page_cleaner_close();
+ /* waiting for all worker threads exit */
+ while (page_cleaner.n_workers) {
+ os_event_set(page_cleaner.is_requested);
+ os_thread_sleep(10000);
+ }
+
+ mutex_destroy(&page_cleaner.mutex);
+
+ os_event_destroy(page_cleaner.is_finished);
+ os_event_destroy(page_cleaner.is_requested);
buf_page_cleaner_is_active = false;
As noted in MDEV-8188 , the hang can be repeated by running multiple concurrent instances of the server bootstrap, or repeatedly running a single instance of the server bootstrap:
scripts/mysql_install_db --no-defaults --innodb_buffer_pool_size=2G
Marko Mäkelä
made changes -
2018-03-13 07:53
issue.field.resolutiondate
2018-03-13 07:53:30.0
2018-03-13 07:53:30.062
Marko Mäkelä
made changes -
2018-03-13 07:53
Fix Version/s
10.2.14
[ 22911
]
Fix Version/s
10.3.6
[ 23003
]
Fix Version/s
10.2
[ 14601
]
Fix Version/s
10.3
[ 22126
]
Resolution
Fixed
[ 1
]
Status
Open
[ 1
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2021-12-06 21:46
Workflow
MariaDB v3
[ 85994
]
MariaDB v4
[ 153948
]
{"report":{"fcp":1192,"ttfb":255.2000002861023,"pageVisibility":"visible","entityId":66291,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"bd5a4215-d21e-43b2-8cd9-f29684e231cd","navigationType":0,"readyForUser":1306,"redirectCount":0,"resourceLoadedEnd":1583.0999999046326,"resourceLoadedStart":262.2000002861023,"resourceTiming":[{"duration":302.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":262.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":262.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":565,"responseStart":0,"secureConnectionStart":0},{"duration":313.2000002861023,"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":262.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":262.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":575.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":391.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":262.7000002861023,"connectEnd":262.7000002861023,"connectStart":262.7000002861023,"domainLookupEnd":262.7000002861023,"domainLookupStart":262.7000002861023,"fetchStart":262.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":262.7000002861023,"responseEnd":654.5999999046326,"responseStart":654.5999999046326,"secureConnectionStart":262.7000002861023},{"duration":489.90000009536743,"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":262.80000019073486,"connectEnd":262.80000019073486,"connectStart":262.80000019073486,"domainLookupEnd":262.80000019073486,"domainLookupStart":262.80000019073486,"fetchStart":262.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":262.80000019073486,"responseEnd":752.7000002861023,"responseStart":752.7000002861023,"secureConnectionStart":262.80000019073486},{"duration":493.5,"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":263.09999990463257,"connectEnd":263.09999990463257,"connectStart":263.09999990463257,"domainLookupEnd":263.09999990463257,"domainLookupStart":263.09999990463257,"fetchStart":263.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":263.09999990463257,"responseEnd":756.5999999046326,"responseStart":756.5999999046326,"secureConnectionStart":263.09999990463257},{"duration":494,"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":263.30000019073486,"connectEnd":263.30000019073486,"connectStart":263.30000019073486,"domainLookupEnd":263.30000019073486,"domainLookupStart":263.30000019073486,"fetchStart":263.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":263.30000019073486,"responseEnd":757.3000001907349,"responseStart":757.3000001907349,"secureConnectionStart":263.30000019073486},{"duration":494.2000002861023,"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":263.5,"connectEnd":263.5,"connectStart":263.5,"domainLookupEnd":263.5,"domainLookupStart":263.5,"fetchStart":263.5,"redirectEnd":0,"redirectStart":0,"requestStart":263.5,"responseEnd":757.7000002861023,"responseStart":757.7000002861023,"secureConnectionStart":263.5},{"duration":548.2000002861023,"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":263.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":263.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":811.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":494.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":263.80000019073486,"connectEnd":263.80000019073486,"connectStart":263.80000019073486,"domainLookupEnd":263.80000019073486,"domainLookupStart":263.80000019073486,"fetchStart":263.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":263.80000019073486,"responseEnd":758,"responseStart":758,"secureConnectionStart":263.80000019073486},{"duration":548.0999999046326,"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":263.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":263.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":812,"responseStart":0,"secureConnectionStart":0},{"duration":494.6000003814697,"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":264.09999990463257,"connectEnd":264.09999990463257,"connectStart":264.09999990463257,"domainLookupEnd":264.09999990463257,"domainLookupStart":264.09999990463257,"fetchStart":264.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":264.09999990463257,"responseEnd":758.7000002861023,"responseStart":758.7000002861023,"secureConnectionStart":264.09999990463257},{"duration":989.6999998092651,"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":265.30000019073486,"connectEnd":265.30000019073486,"connectStart":265.30000019073486,"domainLookupEnd":265.30000019073486,"domainLookupStart":265.30000019073486,"fetchStart":265.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":265.30000019073486,"responseEnd":1255,"responseStart":1255,"secureConnectionStart":265.30000019073486},{"duration":1317.5999999046326,"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":265.5,"connectEnd":265.5,"connectStart":265.5,"domainLookupEnd":265.5,"domainLookupStart":265.5,"fetchStart":265.5,"redirectEnd":0,"redirectStart":0,"requestStart":265.5,"responseEnd":1583.0999999046326,"responseStart":1583.0999999046326,"secureConnectionStart":265.5},{"duration":433.6000003814697,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":826.5999999046326,"connectEnd":826.5999999046326,"connectStart":826.5999999046326,"domainLookupEnd":826.5999999046326,"domainLookupStart":826.5999999046326,"fetchStart":826.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":826.5999999046326,"responseEnd":1260.2000002861023,"responseStart":1260.2000002861023,"secureConnectionStart":826.5999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":60,"responseStart":255,"responseEnd":257,"domLoading":259,"domInteractive":1616,"domContentLoadedEventStart":1616,"domContentLoadedEventEnd":1687,"domComplete":2187,"loadEventStart":2187,"loadEventEnd":2188,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1586.3000001907349},{"name":"bigPipe.sidebar-id.end","time":1587.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":1587.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1590.2000002861023},{"name":"activityTabFullyLoaded","time":1707.7000002861023}],"measures":[],"correlationId":"9dd55a32cf3862","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":128,"dbReadsTimeInMs":23,"dbConnsTimeInMs":33,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}