Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
10.5 , 10.6 , 10.9(EOL) , 10.10(EOL) , 10.11 , 11.0(EOL) , 11.1(EOL) , 11.2(EOL)
This debug assertion failure was observed while testing MDEV-14795 , but it could affect older releases as well.
The scenario is as follows:
A write of a page of a tablespace has been initiated.
Something is suspending further I/O on the tablespace (fil_space_t::set_stopping() ). This could be as part of executing DROP TABLE or anything that rebuilds a table (TRUNCATE TABLE , OPTIMIZE TABLE , ALTER TABLE ), or possibly as part of executing innodb_undo_log_truncate=ON .
The buf_flush_page_cleaner thread encounters some more dirty pages for the table in buf_pool.flush_list , but notices that all further writes to the tablespace need to be discarded. It will release a tablespace reference that it did not hold in the first place.
write_io_callback calls IORequest::write_complete() on the previously submitted write, which will hit the debug assertion failure, catching the corruption of the reference count and flags.
The following patch fixes this so that the tablespace reference will be incremented even though the flags are set.
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
index 10365d167b7..10c084bbbf1 100644
--- a/storage/innobase/include/fil0fil.h
+++ b/storage/innobase/include/fil0fil.h
@@ -1526,9 +1526,11 @@ template<bool have_reference> inline void fil_space_t::flush()
flush_low();
else
{
- if (!(acquire_low() & (STOPPING | CLOSING)))
+ if (!(acquire_low(STOPPING | CLOSING) & (STOPPING | CLOSING)))
+ {
flush_low();
- release();
+ release();
+ }
}
}
The impact of this for non-debug builds should be that the reference count wraps around (from 0 to 536,870,911) and the 3 flags are "decremented".
I believe that this should lead to InnoDB hanging at some point, and possibly a missed fdatasync() or fsync() call (which should not matter much, because the file is typically going to be deleted anyway).
{"report":{"fcp":835.4000000953674,"ttfb":187.40000009536743,"pageVisibility":"visible","entityId":122631,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"2c4c4990-6460-484e-be44-18d4026138a4","navigationType":0,"readyForUser":971.5,"redirectCount":0,"resourceLoadedEnd":864.8000001907349,"resourceLoadedStart":193.10000014305115,"resourceTiming":[{"duration":7,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":193.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":193.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":200.10000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":8,"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":193.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":193.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":201.5,"responseStart":0,"secureConnectionStart":0},{"duration":65,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":193.5,"connectEnd":193.5,"connectStart":193.5,"domainLookupEnd":193.5,"domainLookupStart":193.5,"fetchStart":193.5,"redirectEnd":0,"redirectStart":0,"requestStart":193.5,"responseEnd":258.5,"responseStart":258.5,"secureConnectionStart":193.5},{"duration":315.90000009536743,"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":193.70000004768372,"connectEnd":193.70000004768372,"connectStart":193.70000004768372,"domainLookupEnd":193.70000004768372,"domainLookupStart":193.70000004768372,"fetchStart":193.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":193.70000004768372,"responseEnd":509.60000014305115,"responseStart":509.60000014305115,"secureConnectionStart":193.70000004768372},{"duration":319.5,"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":193.80000019073486,"connectEnd":193.80000019073486,"connectStart":193.80000019073486,"domainLookupEnd":193.80000019073486,"domainLookupStart":193.80000019073486,"fetchStart":193.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":193.80000019073486,"responseEnd":513.3000001907349,"responseStart":513.3000001907349,"secureConnectionStart":193.80000019073486},{"duration":319.7999999523163,"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":193.90000009536743,"connectEnd":193.90000009536743,"connectStart":193.90000009536743,"domainLookupEnd":193.90000009536743,"domainLookupStart":193.90000009536743,"fetchStart":193.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":193.90000009536743,"responseEnd":513.7000000476837,"responseStart":513.7000000476837,"secureConnectionStart":193.90000009536743},{"duration":320.2000000476837,"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":194,"connectEnd":194,"connectStart":194,"domainLookupEnd":194,"domainLookupStart":194,"fetchStart":194,"redirectEnd":0,"redirectStart":0,"requestStart":194,"responseEnd":514.2000000476837,"responseStart":514.1000001430511,"secureConnectionStart":194},{"duration":320.5,"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":194.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":194.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":514.6000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":320.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":194.20000004768372,"connectEnd":194.20000004768372,"connectStart":194.20000004768372,"domainLookupEnd":194.20000004768372,"domainLookupStart":194.20000004768372,"fetchStart":194.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":194.20000004768372,"responseEnd":514.5,"responseStart":514.5,"secureConnectionStart":194.20000004768372},{"duration":320.69999980926514,"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":194.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":194.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":515,"responseStart":0,"secureConnectionStart":0},{"duration":320.7000000476837,"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":194.5,"connectEnd":194.5,"connectStart":194.5,"domainLookupEnd":194.5,"domainLookupStart":194.5,"fetchStart":194.5,"redirectEnd":0,"redirectStart":0,"requestStart":194.5,"responseEnd":515.2000000476837,"responseStart":515.2000000476837,"secureConnectionStart":194.5},{"duration":605.2999999523163,"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":195.10000014305115,"connectEnd":195.10000014305115,"connectStart":195.10000014305115,"domainLookupEnd":195.10000014305115,"domainLookupStart":195.10000014305115,"fetchStart":195.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":195.10000014305115,"responseEnd":800.4000000953674,"responseStart":800.4000000953674,"secureConnectionStart":195.10000014305115},{"duration":624.7999999523163,"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":195.20000004768372,"connectEnd":195.20000004768372,"connectStart":195.20000004768372,"domainLookupEnd":195.20000004768372,"domainLookupStart":195.20000004768372,"fetchStart":195.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":195.20000004768372,"responseEnd":820,"responseStart":820,"secureConnectionStart":195.20000004768372},{"duration":390.2999999523163,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":408.90000009536743,"connectEnd":408.90000009536743,"connectStart":408.90000009536743,"domainLookupEnd":408.90000009536743,"domainLookupStart":408.90000009536743,"fetchStart":408.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":408.90000009536743,"responseEnd":799.2000000476837,"responseStart":799.2000000476837,"secureConnectionStart":408.90000009536743},{"duration":3,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":827.3000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":827.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":830.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":3.799999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":851.8000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":851.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":855.6000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":4.799999952316284,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":852.6000001430511,"connectEnd":852.6000001430511,"connectStart":852.6000001430511,"domainLookupEnd":852.6000001430511,"domainLookupStart":852.6000001430511,"fetchStart":852.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":852.6000001430511,"responseEnd":857.4000000953674,"responseStart":857.4000000953674,"secureConnectionStart":852.6000001430511},{"duration":11.700000047683716,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":853.1000001430511,"connectEnd":853.1000001430511,"connectStart":853.1000001430511,"domainLookupEnd":853.1000001430511,"domainLookupStart":853.1000001430511,"fetchStart":853.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":853.1000001430511,"responseEnd":864.8000001907349,"responseStart":864.8000001907349,"secureConnectionStart":853.1000001430511}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":19,"responseStart":187,"responseEnd":191,"domLoading":190,"domInteractive":1045,"domContentLoadedEventStart":1045,"domContentLoadedEventEnd":1097,"domComplete":1861,"loadEventStart":1861,"loadEventEnd":1863,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1009.2000000476837},{"name":"bigPipe.sidebar-id.end","time":1010},{"name":"bigPipe.activity-panel-pipe-id.start","time":1010.1000001430511},{"name":"bigPipe.activity-panel-pipe-id.end","time":1012.7000000476837},{"name":"activityTabFullyLoaded","time":1104.3000001907349}],"measures":[],"correlationId":"df69d5fcd2f984","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":80,"dbReadsTimeInMs":11,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}