Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
10.0.1 , 5.5.30 , 5.1.67 , 5.2.14 , 5.3.12
Component/s:
None
Function _ma_apply_undo_row_insert() (starts at line 6887 of storage/maria/ma_blockrec.c) doesn't look right. All through the function if some error condition happens it jumps to the 'err' label, but from there it jumps back to the 'end' label. And here first it calls _ma_bitmap_flushable(info, -1) which seems to be necessary only after the call to _ma_bitmap_flushable(info, 1). But jump to the 'err' label can happen before that call.
And second at the 'end' label it calls _ma_unpin_all_pages_and_finalize_row(info, lsn). But variable 'lsn' gets initialized only after 4 possible jumps to the 'err' label and I don't see a possible path inside _ma_unpin_all_pages_and_finalize_row that won't use contents of 'lsn' variable.
All this doesn't look right and needs some fixing.
{"report":{"fcp":1116.2000000476837,"ttfb":241.5,"pageVisibility":"visible","entityId":23142,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"59751ee9-f791-4aca-b1d4-d998c1128a5b","navigationType":0,"readyForUser":1181.5999999046326,"redirectCount":0,"resourceLoadedEnd":1402.0999999046326,"resourceLoadedStart":254.70000004768372,"resourceTiming":[{"duration":358.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":254.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":254.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":613,"responseStart":0,"secureConnectionStart":0},{"duration":358.2000000476837,"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":255,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":255,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":613.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":367.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":255.20000004768372,"connectEnd":255.20000004768372,"connectStart":255.20000004768372,"domainLookupEnd":255.20000004768372,"domainLookupStart":255.20000004768372,"fetchStart":255.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":255.20000004768372,"responseEnd":622.4000000953674,"responseStart":622.4000000953674,"secureConnectionStart":255.20000004768372},{"duration":396.5,"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":255.29999995231628,"connectEnd":255.29999995231628,"connectStart":255.29999995231628,"domainLookupEnd":255.29999995231628,"domainLookupStart":255.29999995231628,"fetchStart":255.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":255.29999995231628,"responseEnd":651.7999999523163,"responseStart":651.7999999523163,"secureConnectionStart":255.29999995231628},{"duration":400.2999999523163,"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":255.5,"connectEnd":255.5,"connectStart":255.5,"domainLookupEnd":255.5,"domainLookupStart":255.5,"fetchStart":255.5,"redirectEnd":0,"redirectStart":0,"requestStart":255.5,"responseEnd":655.7999999523163,"responseStart":655.7999999523163,"secureConnectionStart":255.5},{"duration":400.5,"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":255.70000004768372,"connectEnd":255.70000004768372,"connectStart":255.70000004768372,"domainLookupEnd":255.70000004768372,"domainLookupStart":255.70000004768372,"fetchStart":255.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":255.70000004768372,"responseEnd":656.2000000476837,"responseStart":656.2000000476837,"secureConnectionStart":255.70000004768372},{"duration":400.7999999523163,"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":255.79999995231628,"connectEnd":255.79999995231628,"connectStart":255.79999995231628,"domainLookupEnd":255.79999995231628,"domainLookupStart":255.79999995231628,"fetchStart":255.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":255.79999995231628,"responseEnd":656.5999999046326,"responseStart":656.5999999046326,"secureConnectionStart":255.79999995231628},{"duration":515.4000000953674,"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":256.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":256.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":771.5,"responseStart":0,"secureConnectionStart":0},{"duration":400.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":256.2000000476837,"connectEnd":256.2000000476837,"connectStart":256.2000000476837,"domainLookupEnd":256.2000000476837,"domainLookupStart":256.2000000476837,"fetchStart":256.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":256.2000000476837,"responseEnd":657,"responseStart":657,"secureConnectionStart":256.2000000476837},{"duration":515.2999999523163,"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":256.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":256.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":771.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":401.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":256.59999990463257,"connectEnd":256.59999990463257,"connectStart":256.59999990463257,"domainLookupEnd":256.59999990463257,"domainLookupStart":256.59999990463257,"fetchStart":256.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":256.59999990463257,"responseEnd":657.7999999523163,"responseStart":657.7999999523163,"secureConnectionStart":256.59999990463257},{"duration":719.3999998569489,"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":257.40000009536743,"connectEnd":257.40000009536743,"connectStart":257.40000009536743,"domainLookupEnd":257.40000009536743,"domainLookupStart":257.40000009536743,"fetchStart":257.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":257.40000009536743,"responseEnd":976.7999999523163,"responseStart":976.7999999523163,"secureConnectionStart":257.40000009536743},{"duration":1129.8999998569489,"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":257.40000009536743,"connectEnd":257.40000009536743,"connectStart":257.40000009536743,"domainLookupEnd":257.40000009536743,"domainLookupStart":257.40000009536743,"fetchStart":257.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":257.40000009536743,"responseEnd":1387.2999999523163,"responseStart":1387.2999999523163,"secureConnectionStart":257.40000009536743},{"duration":232.29999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":784.9000000953674,"connectEnd":784.9000000953674,"connectStart":784.9000000953674,"domainLookupEnd":784.9000000953674,"domainLookupStart":784.9000000953674,"fetchStart":784.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":784.9000000953674,"responseEnd":1017.2000000476837,"responseStart":1017.2000000476837,"secureConnectionStart":784.9000000953674},{"duration":332.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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&whisper-enabled=true","startTime":1067.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1067.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1400.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":333.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/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&whisper-enabled=true","startTime":1068.2999999523163,"connectEnd":1068.2999999523163,"connectStart":1068.2999999523163,"domainLookupEnd":1068.2999999523163,"domainLookupStart":1068.2999999523163,"fetchStart":1068.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":1068.2999999523163,"responseEnd":1402.0999999046326,"responseStart":1402.0999999046326,"secureConnectionStart":1068.2999999523163},{"duration":340.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/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&whisper-enabled=true","startTime":1068.5999999046326,"connectEnd":1068.5999999046326,"connectStart":1068.5999999046326,"domainLookupEnd":1068.5999999046326,"domainLookupStart":1068.5999999046326,"fetchStart":1068.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1068.5999999046326,"responseEnd":1409,"responseStart":1409,"secureConnectionStart":1068.5999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":50,"responseStart":241,"responseEnd":253,"domLoading":245,"domInteractive":1409,"domContentLoadedEventStart":1409,"domContentLoadedEventEnd":1447,"domComplete":1771,"loadEventStart":1771,"loadEventEnd":1772,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1389},{"name":"bigPipe.sidebar-id.end","time":1389.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1390},{"name":"bigPipe.activity-panel-pipe-id.end","time":1391.0999999046326},{"name":"activityTabFullyLoaded","time":1508.7000000476837}],"measures":[],"correlationId":"75590a93bdd6f1","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":114,"dbReadsTimeInMs":9,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The code is:
end:
if (info->non_flushable_state)
_ma_bitmap_flushable(info, -1);
The variable non_flushable_state is true if and only if we called _ma_bitmap_flushable(info, 1) before in this function.
So it means that the code is correct when it comes to the first point.
I will however add a comment about this.
The second case is a kind of a bug. It doesn't matter that LSN is a wrong number as we are marking the table as crashed. However, to make things predictable it's better to use a known LSN here.
Thanks a lot for looking and trying to understand the code.