Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
5.5(EOL) , 10.1(EOL) , 10.2(EOL) , 10.3(EOL) , 10.4(EOL) , 10.5
In a bug fix in MySQL 5.7.6 , the InnoDB function btr_cur_open_at_rnd_pos() was corrected so that it would return a status that indicates whether the cursor was successfully positioned. But this change was not correctly merged to MariaDB (Merge MySQL 5.7.9 , part of MDEV-6113 ). That is, in the code path that was introduced in MDEV-8588 , we would wrongly return success. The following patch fixes the problem:
diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc
index 349ae990edb..b23cacac227 100644
--- a/storage/innobase/btr/btr0cur.cc
+++ b/storage/innobase/btr/btr0cur.cc
@@ -2658,7 +2658,7 @@ btr_cur_open_at_rnd_pos_func(
index->table->file_unreadable = true;
}
- goto exit_loop;
+ break;
}
page = buf_block_get_frame(block);
@@ -2815,12 +2815,11 @@ btr_cur_open_at_rnd_pos_func(
n_blocks++;
}
- exit_loop:
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
- return(true);
+ return err == DB_SUCCESS;
}
/*==================== B-TREE INSERT =========================*/
This problem was accidentally found by frequent crashes of the test innodb.leaf_page_corrupted_during_recovery after removing the function page_copy_rec_list_end_to_created_page() , in preparation for MDEV-12353 . There is no deterministic test case for this.
The symptoms were as follows:
mysqld: /mariadb/10.5/storage/innobase/btr/btr0cur.cc:7116: ulint btr_rec_get_externally_stored_len(const rec_t*, const ulint*): Assertion `!rec_offs_comp(offsets) || !rec_get_node_ptr_flag(rec)' failed.
…
#8 0x00005565cd35d2a8 in btr_rec_get_externally_stored_len (rec=0x7fe096f4807e "\200", offsets=0x7fe03c13a9c0) at /mariadb/10.5-merge/storage/innobase/btr/btr0cur.cc:7116
#9 0x00005565cd35cdd6 in btr_estimate_number_of_different_key_vals (index=0x7fe0640123e8) at /mariadb/10.5-merge/storage/innobase/btr/btr0cur.cc:6988
#10 0x00005565cd41a303 in dict_stats_update_transient_for_index (index=0x7fe0640123e8) at /mariadb/10.5-merge/storage/innobase/dict/dict0stats.cc:886
#11 0x00005565cd41a582 in dict_stats_update_transient (table=0x7fe064010658) at /mariadb/10.5-merge/storage/innobase/dict/dict0stats.cc:944
#12 0x00005565cd420701 in dict_stats_update (table=0x7fe064010658, stats_upd_option=DICT_STATS_RECALC_TRANSIENT) at /mariadb/10.5-merge/storage/innobase/dict/dict0stats.cc:3343
#13 0x00005565cd06f481 in dict_stats_init (table=0x7fe064010658) at /mariadb/10.5-merge/storage/innobase/include/dict0stats.ic:165
#14 0x00005565cd079df9 in ha_innobase::open (this=0x7fe03c13b8d0, name=0x7fe03c13efa8 "./test/t1") at /mariadb/10.5-merge/storage/innobase/handler/ha_innodb.cc:6020
The assertion would fail on the very first access on the table, after starting up with innodb_force_recovery=1 (to ignore the corruption that was injected to the leaf page).
Transition
Time In Source Status
Execution Times
Open
Closed
35m 5s
1
{"report":{"fcp":2230.9000000953674,"ttfb":575.6000001430511,"pageVisibility":"visible","entityId":78887,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"e7dc08f7-7e00-461d-ab6a-3721af60894a","navigationType":0,"readyForUser":2334.7000000476837,"redirectCount":0,"resourceLoadedEnd":1893.9000000953674,"resourceLoadedStart":583.9000000953674,"resourceTiming":[{"duration":351.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":583.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":583.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":935.1000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":351.59999990463257,"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":584.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":584.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":935.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":999.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":584.5,"connectEnd":584.5,"connectStart":584.5,"domainLookupEnd":584.5,"domainLookupStart":584.5,"fetchStart":584.5,"redirectEnd":0,"redirectStart":0,"requestStart":963.2999999523163,"responseEnd":1584.2999999523163,"responseStart":1032.5,"secureConnectionStart":584.5},{"duration":1306,"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":584.6000001430511,"connectEnd":584.6000001430511,"connectStart":584.6000001430511,"domainLookupEnd":584.6000001430511,"domainLookupStart":584.6000001430511,"fetchStart":584.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":963.7999999523163,"responseEnd":1890.6000001430511,"responseStart":1038.1000001430511,"secureConnectionStart":584.6000001430511},{"duration":459.90000009536743,"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":584.7000000476837,"connectEnd":584.7000000476837,"connectStart":584.7000000476837,"domainLookupEnd":584.7000000476837,"domainLookupStart":584.7000000476837,"fetchStart":584.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":964.4000000953674,"responseEnd":1044.6000001430511,"responseStart":1040.9000000953674,"secureConnectionStart":584.7000000476837},{"duration":456.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":588.2000000476837,"connectEnd":588.2000000476837,"connectStart":588.2000000476837,"domainLookupEnd":588.2000000476837,"domainLookupStart":588.2000000476837,"fetchStart":588.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":964.9000000953674,"responseEnd":1044.7000000476837,"responseStart":1041.5,"secureConnectionStart":588.2000000476837},{"duration":456.40000009536743,"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":588.5,"connectEnd":588.5,"connectStart":588.5,"domainLookupEnd":588.5,"domainLookupStart":588.5,"fetchStart":588.5,"redirectEnd":0,"redirectStart":0,"requestStart":965.4000000953674,"responseEnd":1044.9000000953674,"responseStart":1042.1000001430511,"secureConnectionStart":588.5},{"duration":362.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":588.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":588.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":951.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":456.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":588.9000000953674,"connectEnd":588.9000000953674,"connectStart":588.9000000953674,"domainLookupEnd":588.9000000953674,"domainLookupStart":588.9000000953674,"fetchStart":588.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":965.9000000953674,"responseEnd":1045.1000001430511,"responseStart":1043.2000000476837,"secureConnectionStart":588.9000000953674},{"duration":363.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":589.1000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":589.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":952.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":469.30000019073486,"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":589.2999999523163,"connectEnd":589.2999999523163,"connectStart":589.2999999523163,"domainLookupEnd":589.2999999523163,"domainLookupStart":589.2999999523163,"fetchStart":589.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":966.4000000953674,"responseEnd":1058.6000001430511,"responseStart":1045.2999999523163,"secureConnectionStart":589.2999999523163},{"duration":1296.5,"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":595.1000001430511,"connectEnd":595.1000001430511,"connectStart":595.1000001430511,"domainLookupEnd":595.1000001430511,"domainLookupStart":595.1000001430511,"fetchStart":595.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":1284.7000000476837,"responseEnd":1891.6000001430511,"responseStart":1881.6000001430511,"secureConnectionStart":595.1000001430511},{"duration":1298.7999999523163,"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":595.1000001430511,"connectEnd":595.1000001430511,"connectStart":595.1000001430511,"domainLookupEnd":595.1000001430511,"domainLookupStart":595.1000001430511,"fetchStart":595.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":1165.5,"responseEnd":1893.9000000953674,"responseStart":1885.1000001430511,"secureConnectionStart":595.1000001430511},{"duration":231.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1797.7000000476837,"connectEnd":1797.7000000476837,"connectStart":1797.7000000476837,"domainLookupEnd":1797.7000000476837,"domainLookupStart":1797.7000000476837,"fetchStart":1797.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1993.1000001430511,"responseEnd":2029.6000001430511,"responseStart":2028.5,"secureConnectionStart":1797.7000000476837},{"duration":218.70000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":2169.2999999523163,"connectEnd":2169.2999999523163,"connectStart":2169.2999999523163,"domainLookupEnd":2169.2999999523163,"domainLookupStart":2169.2999999523163,"fetchStart":2169.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":2352.7999999523163,"responseEnd":2388,"responseStart":2387.600000143051,"secureConnectionStart":2169.2999999523163},{"duration":254,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":2223.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2223.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2477.7000000476837,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":397,"responseStart":575,"responseEnd":580,"domLoading":581,"domInteractive":2515,"domContentLoadedEventStart":2515,"domContentLoadedEventEnd":2579,"domComplete":2848,"loadEventStart":2848,"loadEventEnd":2848,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2479.600000143051},{"name":"bigPipe.sidebar-id.end","time":2480.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":2480.600000143051},{"name":"bigPipe.activity-panel-pipe-id.end","time":2481.2999999523163},{"name":"activityTabFullyLoaded","time":2594.600000143051}],"measures":[],"correlationId":"5659bc22011b19","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":17,"dbConnsTimeInMs":26,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}