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).
Marko Mäkelä
made changes -
2019-09-11 12:42
issue.field.resolutiondate
2019-09-11 12:42:49.0
2019-09-11 12:42:49.516
Marko Mäkelä
made changes -
2019-09-11 12:42
Fix Version/s
10.2.28
[ 23910
]
Fix Version/s
10.3.19
[ 23908
]
Fix Version/s
10.4.9
[ 23906
]
Fix Version/s
10.2
[ 14601
]
Fix Version/s
10.3
[ 22126
]
Fix Version/s
10.4
[ 22408
]
Fix Version/s
10.5
[ 23123
]
Resolution
Fixed
[ 1
]
Status
Open
[ 1
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2021-12-06 21:50
Workflow
MariaDB v3
[ 99589
]
MariaDB v4
[ 156728
]
{"report":{"fcp":2285.699999809265,"ttfb":969.5,"pageVisibility":"visible","entityId":78887,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"34e12959-19b6-4ee1-b7e2-b74c4f34492a","navigationType":0,"readyForUser":2385.300000190735,"redirectCount":0,"resourceLoadedEnd":2687,"resourceLoadedStart":975.3000001907349,"resourceTiming":[{"duration":797.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":975.3000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":975.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1773.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":797,"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":976.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":976.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1773.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":806,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":976.6999998092651,"connectEnd":976.6999998092651,"connectStart":976.6999998092651,"domainLookupEnd":976.6999998092651,"domainLookupStart":976.6999998092651,"fetchStart":976.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":976.6999998092651,"responseEnd":1782.6999998092651,"responseStart":1782.6999998092651,"secureConnectionStart":976.6999998092651},{"duration":973,"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":976.8000001907349,"connectEnd":976.8000001907349,"connectStart":976.8000001907349,"domainLookupEnd":976.8000001907349,"domainLookupStart":976.8000001907349,"fetchStart":976.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":976.8000001907349,"responseEnd":1949.8000001907349,"responseStart":1949.8000001907349,"secureConnectionStart":976.8000001907349},{"duration":977.1999998092651,"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":977,"connectEnd":977,"connectStart":977,"domainLookupEnd":977,"domainLookupStart":977,"fetchStart":977,"redirectEnd":0,"redirectStart":0,"requestStart":977,"responseEnd":1954.1999998092651,"responseStart":1954.1999998092651,"secureConnectionStart":977},{"duration":977.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":977.1999998092651,"connectEnd":977.1999998092651,"connectStart":977.1999998092651,"domainLookupEnd":977.1999998092651,"domainLookupStart":977.1999998092651,"fetchStart":977.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":977.1999998092651,"responseEnd":1954.6999998092651,"responseStart":1954.6999998092651,"secureConnectionStart":977.1999998092651},{"duration":977.5999999046326,"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":977.4000000953674,"connectEnd":977.4000000953674,"connectStart":977.4000000953674,"domainLookupEnd":977.4000000953674,"domainLookupStart":977.4000000953674,"fetchStart":977.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":977.4000000953674,"responseEnd":1955,"responseStart":1955,"secureConnectionStart":977.4000000953674},{"duration":979.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":977.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":977.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1957,"responseStart":0,"secureConnectionStart":0},{"duration":977.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":977.8000001907349,"connectEnd":977.8000001907349,"connectStart":977.8000001907349,"domainLookupEnd":977.8000001907349,"domainLookupStart":977.8000001907349,"fetchStart":977.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":977.8000001907349,"responseEnd":1955.4000000953674,"responseStart":1955.4000000953674,"secureConnectionStart":977.8000001907349},{"duration":979.0999999046326,"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":978,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":978,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1957.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":978,"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":978.0999999046326,"connectEnd":978.0999999046326,"connectStart":978.0999999046326,"domainLookupEnd":978.0999999046326,"domainLookupStart":978.0999999046326,"fetchStart":978.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":978.0999999046326,"responseEnd":1956.0999999046326,"responseStart":1956.0999999046326,"secureConnectionStart":978.0999999046326},{"duration":1407.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":979.0999999046326,"connectEnd":979.0999999046326,"connectStart":979.0999999046326,"domainLookupEnd":979.0999999046326,"domainLookupStart":979.0999999046326,"fetchStart":979.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":979.0999999046326,"responseEnd":2386.800000190735,"responseStart":2386.800000190735,"secureConnectionStart":979.0999999046326},{"duration":1707.8000001907349,"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":979.1999998092651,"connectEnd":979.1999998092651,"connectStart":979.1999998092651,"domainLookupEnd":979.1999998092651,"domainLookupStart":979.1999998092651,"fetchStart":979.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":979.1999998092651,"responseEnd":2687,"responseStart":2687,"secureConnectionStart":979.1999998092651},{"duration":435.2000002861023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1948.0999999046326,"connectEnd":1948.0999999046326,"connectStart":1948.0999999046326,"domainLookupEnd":1948.0999999046326,"domainLookupStart":1948.0999999046326,"fetchStart":1948.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1948.0999999046326,"responseEnd":2383.300000190735,"responseStart":2383.300000190735,"secureConnectionStart":1948.0999999046326},{"duration":430.09999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":2279.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2279.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2709.699999809265,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":783,"responseStart":969,"responseEnd":971,"domLoading":973,"domInteractive":2716,"domContentLoadedEventStart":2716,"domContentLoadedEventEnd":2779,"domComplete":3185,"loadEventStart":3185,"loadEventEnd":3185,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2692.699999809265},{"name":"bigPipe.sidebar-id.end","time":2693.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":2693.699999809265},{"name":"bigPipe.activity-panel-pipe-id.end","time":2696},{"name":"activityTabFullyLoaded","time":2797.5999999046326}],"measures":[],"correlationId":"9870adebcb086e","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":123,"dbReadsTimeInMs":20,"dbConnsTimeInMs":29,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}