MDEV-15528 implemented an optimization: pages that have been marked as freed will not be written back to data files. Unfortunately, this optimization violates the write-ahead logging protocol, because we fail to ensure that all log up to the freeing of the page has been durably written before we elide the write of the data page.
If InnoDB is killed before the log for freeing a page was durably written, crash recovery could fail because it would read an older version of the data page and attempt to apply log records that are for a newer version of the page.
We can observe some occasional recovery test failures that could be explained by this, such as the following:
10.6 56c9b0bca0576985c31f20b46dcb060a
atomic.alter_table 'innodb' w1 [ fail ] Found warnings/errors in server log file!
Test ended at 2023-01-10 11:25:39
line
2023-01-10 11:24:24 0 [ERROR] InnoDB: Corrupted page [page id: space=228, page number=0] of datafile './test/t1.ibd' could not be found in the doublewrite buffer.
The scenario that I have in mind would be fixed by making buf_page_free() mark the freed block as modified in the mini-transaction, and buf_flush_page() check that everything up to the FIL_PAGE_LSN of the page has been durably written to the redo log. After first change, that field would be updated by buf_flush_note_modification(), which is invoked by mtr_t::commit().
In 10.6, buf_page_free() invokes mtr->memo_push(block, MTR_MEMO_PAGE_X_MODIFY) ever since MDEV-29374 was fixed. But the check in buf_page_t::flush() is missing.
Marko Mäkelä
added a comment - In 10.6, buf_page_free() invokes mtr->memo_push(block, MTR_MEMO_PAGE_X_MODIFY) ever since MDEV-29374 was fixed. But the check in buf_page_t::flush() is missing.
People
Marko Mäkelä
Marko Mäkelä
Votes:
0Vote for this issue
Watchers:
1Start 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":1207.8999999761581,"ttfb":275.09999990463257,"pageVisibility":"visible","entityId":125914,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"e37525e1-d8ec-44ff-b516-1ca07c2373e3","navigationType":0,"readyForUser":1322.0999999046326,"redirectCount":0,"resourceLoadedEnd":978.2999999523163,"resourceLoadedStart":283.59999990463257,"resourceTiming":[{"duration":268.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":283.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":283.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":551.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":276.60000002384186,"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":291.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":291.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":567.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":439.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":291.5,"connectEnd":291.5,"connectStart":291.5,"domainLookupEnd":291.5,"domainLookupStart":291.5,"fetchStart":291.5,"redirectEnd":0,"redirectStart":0,"requestStart":570,"responseEnd":730.7999999523163,"responseStart":588,"secureConnectionStart":291.5},{"duration":619.7000000476837,"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":292.2999999523163,"connectEnd":292.2999999523163,"connectStart":292.2999999523163,"domainLookupEnd":292.2999999523163,"domainLookupStart":292.2999999523163,"fetchStart":292.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":571.6999999284744,"responseEnd":912,"responseStart":599.5,"secureConnectionStart":292.2999999523163},{"duration":314.10000002384186,"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":292.59999990463257,"connectEnd":292.59999990463257,"connectStart":292.59999990463257,"domainLookupEnd":292.59999990463257,"domainLookupStart":292.59999990463257,"fetchStart":292.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":577,"responseEnd":606.6999999284744,"responseStart":604.0999999046326,"secureConnectionStart":292.59999990463257},{"duration":311.10000002384186,"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":292.7999999523163,"connectEnd":292.7999999523163,"connectStart":292.7999999523163,"domainLookupEnd":292.7999999523163,"domainLookupStart":292.7999999523163,"fetchStart":292.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":576.1999999284744,"responseEnd":603.8999999761581,"responseStart":602.6999999284744,"secureConnectionStart":292.7999999523163},{"duration":313.89999997615814,"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":293,"connectEnd":293,"connectStart":293,"domainLookupEnd":293,"domainLookupStart":293,"fetchStart":293,"redirectEnd":0,"redirectStart":0,"requestStart":579.5999999046326,"responseEnd":606.8999999761581,"responseStart":604.8999999761581,"secureConnectionStart":293},{"duration":280.7000000476837,"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":293.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":293.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":573.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":313.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":293.2999999523163,"connectEnd":293.2999999523163,"connectStart":293.2999999523163,"domainLookupEnd":293.2999999523163,"domainLookupStart":293.2999999523163,"fetchStart":293.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":579.6999999284744,"responseEnd":607.1999999284744,"responseStart":605.5,"secureConnectionStart":293.2999999523163},{"duration":282.1999999284744,"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":293.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":293.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":575.6999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":317.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":293.59999990463257,"connectEnd":293.59999990463257,"connectStart":293.59999990463257,"domainLookupEnd":293.59999990463257,"domainLookupStart":293.59999990463257,"fetchStart":293.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":579.7999999523163,"responseEnd":610.7999999523163,"responseStart":609.6999999284744,"secureConnectionStart":293.59999990463257},{"duration":595.2999999523163,"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":298.39999997615814,"connectEnd":298.39999997615814,"connectStart":298.39999997615814,"domainLookupEnd":298.39999997615814,"domainLookupStart":298.39999997615814,"fetchStart":298.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":846.3999999761581,"responseEnd":893.6999999284744,"responseStart":889.5999999046326,"secureConnectionStart":298.39999997615814},{"duration":679.7999999523163,"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":298.5,"connectEnd":298.5,"connectStart":298.5,"domainLookupEnd":298.5,"domainLookupStart":298.5,"fetchStart":298.5,"redirectEnd":0,"redirectStart":0,"requestStart":964.5,"responseEnd":978.2999999523163,"responseStart":977.6999999284744,"secureConnectionStart":298.5},{"duration":151.29999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":857.7999999523163,"connectEnd":857.7999999523163,"connectStart":857.7999999523163,"domainLookupEnd":857.7999999523163,"domainLookupStart":857.7999999523163,"fetchStart":857.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":970.5999999046326,"responseEnd":1009.0999999046326,"responseStart":1007.5999999046326,"secureConnectionStart":857.7999999523163}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":86,"responseStart":275,"responseEnd":298,"domLoading":278,"domInteractive":1371,"domContentLoadedEventStart":1371,"domContentLoadedEventEnd":1412,"domComplete":2615,"loadEventStart":2615,"loadEventEnd":2615,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1354.8999999761581},{"name":"bigPipe.sidebar-id.end","time":1355.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1355.6999999284744},{"name":"bigPipe.activity-panel-pipe-id.end","time":1356.6999999284744},{"name":"activityTabFullyLoaded","time":1427.1999999284744}],"measures":[],"correlationId":"1d72417c76af67","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":117,"dbReadsTimeInMs":14,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
In 10.6, buf_page_free() invokes mtr->memo_push(block, MTR_MEMO_PAGE_X_MODIFY) ever since
MDEV-29374was fixed. But the check in buf_page_t::flush() is missing.