This bug was found related to MDEV-34212.
Some InnoDB tests, most notably, innodb.table_flags,64k, would occasionally fail. I am able to reproduce this locally on a MemorySanitizer build, some of the time. The attached file data.tar.xz
is a copy of the data directory of a failed test in a 10.4 based branch that contains a fix of MDEV-34212.
I was able to reproduce the problem with an even simpler test case:
tf.test
|
--source include/have_innodb.inc
|
SELECT @@innodb_page_size;
|
and the following options:
tf.opt
|
--innodb-undo-tablespaces=0 --innodb-page-size=64k --innodb-buffer-pool-size=20m
|
I was able to produce an rr replay by repeatedly running the following on a MemorySanitizer build:
while ./mtr --boot-rr --parallel=60 innodb.tf{,,,,,,,,,}{,}{,,}; do :; done
|
In the rr replay trace, I concluded that the problem is that the last write of the undo page 50 is being discarded due to a condition in buf_page_t::flush():
if (UNIV_UNLIKELY(lsn < space->get_create_lsn()))
|
{
|
ut_ad(space->purpose == FIL_TYPE_TABLESPACE);
|
goto freed;
|
}
|
The bug seems to be a conflict between the supposedly final buffer pool flushing and fsp_system_tablespace_truncate(). Here are some stack traces, from the same thread:
buf_page_t::flush()
|
buf_do_flush_list_batch (max_n=2000, lsn=18446744073709551615)
|
buf_flush_list_holding_mutex (max_n=max_n@entry=2000, lsn=lsn@entry=18446744073709551615)
|
buf_flush_list (max_n=2000, lsn=lsn@entry=18446744073709551615)
|
buf_flush_buffer_pool ()
|
logs_empty_and_mark_files_at_shutdown ()
|
innodb_shutdown ()
|
innobase_end ()
|
The system tablespace truncation had been invoked a little earlier in the same thread:
fil_space_t::set_create_lsn (this=0x71100001b080, lsn=58443)
|
mtr_t::commit_shrink (...)
|
fsp_system_tablespace_truncate ()
|
innobase_end () at /mariadb/11.4/storage/innobase/handler/ha_innodb.cc:4269
|
{"report":{"fcp":1066.8000001907349,"ttfb":292.1000003814697,"pageVisibility":"visible","entityId":129249,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"88c85335-191f-44ec-b9f5-2a474a123975","navigationType":0,"readyForUser":1159.4000000953674,"redirectCount":0,"resourceLoadedEnd":1775.6000003814697,"resourceLoadedStart":297.40000009536743,"resourceTiming":[{"duration":208.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":297.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":297.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":506.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":208.89999961853027,"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":297.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":297.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":506.5,"responseStart":0,"secureConnectionStart":0},{"duration":362.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":297.80000019073486,"connectEnd":297.80000019073486,"connectStart":297.80000019073486,"domainLookupEnd":297.80000019073486,"domainLookupStart":297.80000019073486,"fetchStart":297.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":297.80000019073486,"responseEnd":660.7000002861023,"responseStart":660.7000002861023,"secureConnectionStart":297.80000019073486},{"duration":388.7000002861023,"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":298,"connectEnd":298,"connectStart":298,"domainLookupEnd":298,"domainLookupStart":298,"fetchStart":298,"redirectEnd":0,"redirectStart":0,"requestStart":298,"responseEnd":686.7000002861023,"responseStart":686.7000002861023,"secureConnectionStart":298},{"duration":392.09999990463257,"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":298.30000019073486,"connectEnd":298.30000019073486,"connectStart":298.30000019073486,"domainLookupEnd":298.30000019073486,"domainLookupStart":298.30000019073486,"fetchStart":298.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":298.30000019073486,"responseEnd":690.4000000953674,"responseStart":690.4000000953674,"secureConnectionStart":298.30000019073486},{"duration":392.40000009536743,"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":298.5,"connectEnd":298.5,"connectStart":298.5,"domainLookupEnd":298.5,"domainLookupStart":298.5,"fetchStart":298.5,"redirectEnd":0,"redirectStart":0,"requestStart":298.5,"responseEnd":690.9000000953674,"responseStart":690.9000000953674,"secureConnectionStart":298.5},{"duration":392.59999990463257,"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":298.7000002861023,"connectEnd":298.7000002861023,"connectStart":298.7000002861023,"domainLookupEnd":298.7000002861023,"domainLookupStart":298.7000002861023,"fetchStart":298.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":298.7000002861023,"responseEnd":691.3000001907349,"responseStart":691.3000001907349,"secureConnectionStart":298.7000002861023},{"duration":395.09999990463257,"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":298.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":298.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":693.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":392.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":299.1000003814697,"connectEnd":299.1000003814697,"connectStart":299.1000003814697,"domainLookupEnd":299.1000003814697,"domainLookupStart":299.1000003814697,"fetchStart":299.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":299.1000003814697,"responseEnd":691.7000002861023,"responseStart":691.7000002861023,"secureConnectionStart":299.1000003814697},{"duration":394.90000009536743,"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":299.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":299.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":694.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":393,"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":299.40000009536743,"connectEnd":299.40000009536743,"connectStart":299.40000009536743,"domainLookupEnd":299.40000009536743,"domainLookupStart":299.40000009536743,"fetchStart":299.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":299.40000009536743,"responseEnd":692.4000000953674,"responseStart":692.4000000953674,"secureConnectionStart":299.40000009536743},{"duration":1082.7000002861023,"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":304.90000009536743,"connectEnd":304.90000009536743,"connectStart":304.90000009536743,"domainLookupEnd":304.90000009536743,"domainLookupStart":304.90000009536743,"fetchStart":304.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":304.90000009536743,"responseEnd":1387.6000003814697,"responseStart":1387.6000003814697,"secureConnectionStart":304.90000009536743},{"duration":1470.6000003814697,"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":305,"connectEnd":305,"connectStart":305,"domainLookupEnd":305,"domainLookupStart":305,"fetchStart":305,"redirectEnd":0,"redirectStart":0,"requestStart":305,"responseEnd":1775.6000003814697,"responseStart":1775.6000003814697,"secureConnectionStart":305},{"duration":887.9000000953674,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":883.2000002861023,"connectEnd":883.2000002861023,"connectStart":883.2000002861023,"domainLookupEnd":883.2000002861023,"domainLookupStart":883.2000002861023,"fetchStart":883.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":883.2000002861023,"responseEnd":1771.1000003814697,"responseStart":1771.1000003814697,"secureConnectionStart":883.2000002861023}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":121,"responseStart":292,"responseEnd":298,"domLoading":296,"domInteractive":1798,"domContentLoadedEventStart":1798,"domContentLoadedEventEnd":1836,"domComplete":2532,"loadEventStart":2532,"loadEventEnd":2534,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1777.2000002861023},{"name":"bigPipe.sidebar-id.end","time":1778.1000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":1778.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1780.7000002861023},{"name":"activityTabFullyLoaded","time":1839.8000001907349}],"measures":[],"correlationId":"7b0bf82aec8b3","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":108,"dbReadsTimeInMs":16,"dbConnsTimeInMs":26,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}