We utilize mariabackup for partial backup and restore operations. However, our automated restore tests have encountered failures at times due to corrupted indexes. After some investigation, I have isolated the issue. It appears not to be a problem with mariabackup or the backup itself, as I was able to reproduce the issue on a local instance as well.
#1 Test Case:
Backup the database files:
rsync -av /var/lib/mysql/db1 /var/tmp/
Recreate database db1:
DROP DATABASE db1;
CREATE DATABASE db1;
Create the database schema without secondary indexes (excerpt):
db1.questionnaire: Warning: InnoDB: Index PRIMARY is marked as corrupted
error: Corrupt
#2 Test Case:
In this case, I considered what would happen if I removed the PRIMARY KEY from the table definition. The steps are the same as above, but without the PRIMARY KEY (id).
This led to a crash:
2024-02-21 10:22:28 37 [ERROR] InnoDB: Trying to read 16384 bytes at 15225848610816 outside the bounds of the file: ./db1/questionnaire.ibd
2024-02-21 10:22:28 37 [ERROR] InnoDB: File './db1/questionnaire.ibd' is corrupted
2024-02-21 10:22:28 37 [Note] InnoDB: Phase III - Flush changes to disk
2024-02-21 10:22:28 37 [Note] InnoDB: Phase IV - Flush complete
2024-02-21 10:22:28 37 [ERROR] InnoDB: Trying to read 16384 bytes at 13850385334272 outside the bounds of the file: ./db1/questionnaire.ibd
2024-02-21 10:22:28 37 [ERROR] InnoDB: Trying to read 16384 bytes at 13850385334272 outside the bounds of the file: ./db1/questionnaire.ibd
240221 10:22:28 [ERROR] mysqld got signal 8 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Server version: 10.6.15-MariaDB-1:10.6.15+maria~deb11 source revision: 0d16eb35bc981023ce2f4912e8ecde68ca381f4e
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=1
max_threads=153
thread_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467985 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x7f2cd8000c58
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
Kernel version: Linux version 6.7.4-200.fc39.x86_64 (mockbuild@de0c58eb5f524c20963d3b29334043cc) (gcc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6), GNU ld version 2.40-14.fc39) #1 SMP PREEMPT_DYNAMIC Mon Feb 5 22:21:14 UTC 2024
Marko Mäkelä
added a comment - The fix of MDEV-18543 was incomplete. I can reproduce this with the following change to an existing test:
diff --git a/mysql-test/suite/innodb/t/instant_alter_import.test b/mysql-test/suite/innodb/t/instant_alter_import.test
index 7bd5645436c..50eda83f4b0 100644
--- a/mysql-test/suite/innodb/t/instant_alter_import.test
+++ b/mysql-test/suite/innodb/t/instant_alter_import.test
@@ -79,6 +79,7 @@ flush tables t2 for export;
unlock tables;
alter table t1 import tablespace;
+--source include/restart_mysqld.inc
select * from t1;
drop table t2;
10.4 662bb176b412993a085fe329af559ddc3dc83ec3 with the above change
CURRENT_TEST: innodb.instant_alter_import
mysqltest: At line 83: query 'select * from t1' failed: 2013: Lost connection to MySQL server during query
…
mysqld: /mariadb/10.4/storage/innobase/include/dict0mem.h:2373: bool dict_index_t::is_instant() const: Assertion `n_core_fields <= n_fields || table->n_dropped()' failed.
I filed https://github.com/MariaDB/server/pull/3190 for the fix.
The "stalled" ticket state in this system can mean almost anything. The states do not even distinguish between "review approved" and "review rejected". In this case, we thought that the fix can be applied without subjecting it to additional stress testing.
Marko Mäkelä
added a comment - The "stalled" ticket state in this system can mean almost anything. The states do not even distinguish between "review approved" and "review rejected". In this case, we thought that the fix can be applied without subjecting it to additional stress testing.
Will there also be a fix for our affecting version 10.6. (our main problem exists on that version)?
Jens Wurster
added a comment - - edited Thanks @Marko.
Will there also be a fix for our affecting version 10.6. (our main problem exists on that version)?
Yes, the 10.4 branch will be merged to all other branches before the upcoming maintenance releases, which should be out in a couple of weeks.
Marko Mäkelä
added a comment - Yes, the 10.4 branch will be merged to all other branches before the upcoming maintenance releases, which should be out in a couple of weeks.
People
Marko Mäkelä
Jens Wurster
Votes:
0Vote for this issue
Watchers:
5Start 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":1038.3000001907349,"ttfb":251.90000009536743,"pageVisibility":"visible","entityId":128012,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"fa3ac944-e078-4728-8233-71af42fa9142","navigationType":0,"readyForUser":1187,"redirectCount":0,"resourceLoadedEnd":1292.5,"resourceLoadedStart":289.30000019073486,"resourceTiming":[{"duration":157.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":289.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":289.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":446.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":157.5,"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":289.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":289.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":447.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":167.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":289.80000019073486,"connectEnd":289.80000019073486,"connectStart":289.80000019073486,"domainLookupEnd":289.80000019073486,"domainLookupStart":289.80000019073486,"fetchStart":289.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":289.80000019073486,"responseEnd":457,"responseStart":457,"secureConnectionStart":289.80000019073486},{"duration":267.30000019073486,"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":289.90000009536743,"connectEnd":289.90000009536743,"connectStart":289.90000009536743,"domainLookupEnd":289.90000009536743,"domainLookupStart":289.90000009536743,"fetchStart":289.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":289.90000009536743,"responseEnd":557.2000002861023,"responseStart":557.2000002861023,"secureConnectionStart":289.90000009536743},{"duration":271.5,"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":290.2000002861023,"connectEnd":290.2000002861023,"connectStart":290.2000002861023,"domainLookupEnd":290.2000002861023,"domainLookupStart":290.2000002861023,"fetchStart":290.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":290.2000002861023,"responseEnd":561.7000002861023,"responseStart":561.7000002861023,"secureConnectionStart":290.2000002861023},{"duration":282.30000019073486,"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":290.40000009536743,"connectEnd":290.40000009536743,"connectStart":290.40000009536743,"domainLookupEnd":290.40000009536743,"domainLookupStart":290.40000009536743,"fetchStart":290.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":290.40000009536743,"responseEnd":572.7000002861023,"responseStart":572.7000002861023,"secureConnectionStart":290.40000009536743},{"duration":283,"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":290.6000003814697,"connectEnd":290.6000003814697,"connectStart":290.6000003814697,"domainLookupEnd":290.6000003814697,"domainLookupStart":290.6000003814697,"fetchStart":290.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":290.6000003814697,"responseEnd":573.6000003814697,"responseStart":573.6000003814697,"secureConnectionStart":290.6000003814697},{"duration":313.90000009536743,"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":290.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":290.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":604.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":284.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":290.90000009536743,"connectEnd":290.90000009536743,"connectStart":290.90000009536743,"domainLookupEnd":290.90000009536743,"domainLookupStart":290.90000009536743,"fetchStart":290.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":290.90000009536743,"responseEnd":575.7000002861023,"responseStart":575.7000002861023,"secureConnectionStart":290.90000009536743},{"duration":313.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":291,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":291,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":604.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":286.09999990463257,"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":291.1000003814697,"connectEnd":291.1000003814697,"connectStart":291.1000003814697,"domainLookupEnd":291.1000003814697,"domainLookupStart":291.1000003814697,"fetchStart":291.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":291.1000003814697,"responseEnd":577.2000002861023,"responseStart":577.2000002861023,"secureConnectionStart":291.1000003814697},{"duration":561.8999996185303,"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":294.6000003814697,"connectEnd":294.6000003814697,"connectStart":294.6000003814697,"domainLookupEnd":294.6000003814697,"domainLookupStart":294.6000003814697,"fetchStart":294.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":294.6000003814697,"responseEnd":856.5,"responseStart":856.5,"secureConnectionStart":294.6000003814697},{"duration":969.0999999046326,"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":294.7000002861023,"connectEnd":294.7000002861023,"connectStart":294.7000002861023,"domainLookupEnd":294.7000002861023,"domainLookupStart":294.7000002861023,"fetchStart":294.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":294.7000002861023,"responseEnd":1263.8000001907349,"responseStart":1263.8000001907349,"secureConnectionStart":294.7000002861023},{"duration":205.09999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":659.3000001907349,"connectEnd":659.3000001907349,"connectStart":659.3000001907349,"domainLookupEnd":659.3000001907349,"domainLookupStart":659.3000001907349,"fetchStart":659.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":659.3000001907349,"responseEnd":864.4000000953674,"responseStart":864.4000000953674,"secureConnectionStart":659.3000001907349},{"duration":318.2999997138977,"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":974.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":974.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1292.5,"responseStart":0,"secureConnectionStart":0},{"duration":289.80000019073486,"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":975.3000001907349,"connectEnd":975.3000001907349,"connectStart":975.3000001907349,"domainLookupEnd":975.3000001907349,"domainLookupStart":975.3000001907349,"fetchStart":975.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":975.3000001907349,"responseEnd":1265.1000003814697,"responseStart":1265.1000003814697,"secureConnectionStart":975.3000001907349},{"duration":299.19999980926514,"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":975.7000002861023,"connectEnd":975.7000002861023,"connectStart":975.7000002861023,"domainLookupEnd":975.7000002861023,"domainLookupStart":975.7000002861023,"fetchStart":975.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":975.7000002861023,"responseEnd":1274.9000000953674,"responseStart":1274.9000000953674,"secureConnectionStart":975.7000002861023},{"duration":339.80000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1026.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1026.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1366.7000002861023,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":60,"responseStart":251,"responseEnd":278,"domLoading":286,"domInteractive":1384,"domContentLoadedEventStart":1384,"domContentLoadedEventEnd":1452,"domComplete":1846,"loadEventStart":1846,"loadEventEnd":1847,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1319.2000002861023},{"name":"bigPipe.sidebar-id.end","time":1320.1000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":1320.2000002861023},{"name":"bigPipe.activity-panel-pipe-id.end","time":1332.7000002861023},{"name":"activityTabFullyLoaded","time":1474.2000002861023}],"measures":[],"correlationId":"43ec6788c890d7","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":110,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The fix of
MDEV-18543was incomplete. I can reproduce this with the following change to an existing test:diff --git a/mysql-test/suite/innodb/t/instant_alter_import.test b/mysql-test/suite/innodb/t/instant_alter_import.test
index 7bd5645436c..50eda83f4b0 100644
--- a/mysql-test/suite/innodb/t/instant_alter_import.test
+++ b/mysql-test/suite/innodb/t/instant_alter_import.test
@@ -79,6 +79,7 @@ flush tables t2 for export;
unlock tables;
alter table t1 import tablespace;
+--source include/restart_mysqld.inc
select * from t1;
10.4 662bb176b412993a085fe329af559ddc3dc83ec3 with the above change
CURRENT_TEST: innodb.instant_alter_import
mysqltest: At line 83: query 'select * from t1' failed: 2013: Lost connection to MySQL server during query
…
mysqld: /mariadb/10.4/storage/innobase/include/dict0mem.h:2373: bool dict_index_t::is_instant() const: Assertion `n_core_fields <= n_fields || table->n_dropped()' failed.
I filed https://github.com/MariaDB/server/pull/3190 for the fix.