This is easily reproducible with the attached files. I am able to recover the backup if I rename some files before starting the restore:
for i in 1 3 4 5 6; do mv data/test/t$i.new data/cool_down/t$i.ibd; done
Also some encryption related paths in data/backup-my.cnf may need to be adjusted. With the files renamed and the encryption parameters adjusted, the data set will recover:
2023-12-04 16:24:39 0 [Note] InnoDB: To recover: 250 pages
[00] 2023-12-04 16:24:40 Last binlog file , position 0
[00] 2023-12-04 16:24:40 completed OK!
The logging and recovery of DDL operations was rewritten in 10.6. Before MDEV-24626 and other changes, it could be very hard to reproduce this type of failures.
I do not think that crash recovery is affected by this. This problem should be unique to backup and code like the following:
10.6 768a736174d6caf09df43e84b0c1b9ec52f1a301
Thread 1 hit Breakpoint 5, 0x00005653c65d0f90 in unlink@plt ()
1: (char*)$rdi = 0x7fffb6a972d0 "./test/t1.ibd"
(rr) bt
#0 0x00005653c65d0f90 in unlink@plt ()
#1 0x00005653c65448aa in my_delete (name=0x7fffb6a972d0 "./test/t1.ibd", MyFlags=16) at /mariadb/10.6/mysys/my_delete.c:43
#2 0x00005653c5c88562 in rename_force (from=0x7fffb6a972b0 "./test/t1.new", to=0x7fffb6a972d0 "./test/t1.ibd") at /mariadb/10.6/extra/mariabackup/xtrabackup.cc:5689
#3 0x00005653c5c8c191 in prepare_handle_new_files (data_home_dir=<optimized out>, db_name=0x7fffb6a98370 "test", file_name=0x7fffb6a99350 "t1.new", arg=0x0) at /usr/include/c++/13/bits/basic_string.h:222
#4 0x00005653c5c8cade in xb_process_datadir (path=path@entry=0x5653c569c798 ".", suffix=suffix@entry=0x5653c567705e ".new",
This assumption will obviously be violated when preparing a backup where tables by the same name have been created, renamed, and dropped. The input that produced data.tar.xz involved several CREATE TABLE in one schema, RENAME TABLE to another schema, and DROP SCHEMA cool_down, in a loop.
Marko Mäkelä
added a comment - I finally found out where the information on the file name is lost. It is in deferred_spaces.add() :
/* The file name must be unique. Keep the one with the latest LSN. */
auto d= defers.begin();
while (d != defers.end())
{
if (d->second.file_name != defer.file_name)
++d;
// …
/* Reset the old tablespace name in recovered spaces list */
recv_spaces_t::iterator it{recv_spaces.find(d->first)};
if (it != recv_spaces.end() &&
it->second.name == d->second.file_name)
it->second.name = "" ;
defers.erase(d++);
This assumption will obviously be violated when preparing a backup where tables by the same name have been created, renamed, and dropped. The input that produced data.tar.xz involved several CREATE TABLE in one schema, RENAME TABLE to another schema, and DROP SCHEMA cool_down , in a loop.
fbackup.tar.xz is a data set that will require a more extensive fix: renaming the expected file names when fil_name_process() will be invoked on FILE_RENAME and the file is not found.
Marko Mäkelä
added a comment - fbackup.tar.xz is a data set that will require a more extensive fix: renaming the expected file names when fil_name_process() will be invoked on FILE_RENAME and the file is not found.
data-fts.tar.xz is one more data set that fails to recover some backed-up files correctly. At least one file (tablespace 15, test/t2.ibd, created during the backup) would incorrectly be recovered as containing only NUL bytes.
Marko Mäkelä
added a comment - data-fts.tar.xz is one more data set that fails to recover some backed-up files correctly. At least one file (tablespace 15, test/t2.ibd , created during the backup) would incorrectly be recovered as containing only NUL bytes.
I revised the logic so that most tables in data-fts.tar.xz would be recovered, but the tables t5 and t7 would be reported corrupted. I do not know if it is related to incorrect encryption parameters.
Marko Mäkelä
added a comment - I revised the logic so that most tables in data-fts.tar.xz would be recovered, but the tables t5 and t7 would be reported corrupted. I do not know if it is related to incorrect encryption parameters.
After a further revision, all tables of data-fts.tar.xz recover, that is, check table t1,t2,t3,t4,t5,t6,t7; reports them OK.
Marko Mäkelä
added a comment - After a further revision, all tables of data-fts.tar.xz recover, that is, check table t1,t2,t3,t4,t5,t6,t7; reports them OK.
origin/10.6-MDEV-32939 f21a6cbf6ee720b35cf3be011dbc4725ad99a5bb 2023-12-14T13:16:28+02:00
performed well in RQG testing. No new problems
Matthias Leich
added a comment - origin/10.6- MDEV-32939 f21a6cbf6ee720b35cf3be011dbc4725ad99a5bb 2023-12-14T13:16:28+02:00
performed well in RQG testing. No new problems
People
Marko Mäkelä
Marko Mäkelä
Votes:
0Vote for this issue
Watchers:
2Start 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":1428.3999996185303,"ttfb":305.8999996185303,"pageVisibility":"visible","entityId":126758,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"405e788f-c73e-4367-9d2c-ba8ffbe295a3","navigationType":0,"readyForUser":1532.7999992370605,"redirectCount":0,"resourceLoadedEnd":1580.3999996185303,"resourceLoadedStart":311.8999996185303,"resourceTiming":[{"duration":577.3000001907349,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":311.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":311.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":889.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":577.3999996185303,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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","startTime":312.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":312.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":889.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":588.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":312.3999996185303,"connectEnd":312.3999996185303,"connectStart":312.3999996185303,"domainLookupEnd":312.3999996185303,"domainLookupStart":312.3999996185303,"fetchStart":312.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":312.3999996185303,"responseEnd":901.0999994277954,"responseStart":901.0999994277954,"secureConnectionStart":312.3999996185303},{"duration":641.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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","startTime":312.5999994277954,"connectEnd":312.5999994277954,"connectStart":312.5999994277954,"domainLookupEnd":312.5999994277954,"domainLookupStart":312.5999994277954,"fetchStart":312.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":312.5999994277954,"responseEnd":954,"responseStart":954,"secureConnectionStart":312.5999994277954},{"duration":645.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":312.8999996185303,"connectEnd":312.8999996185303,"connectStart":312.8999996185303,"domainLookupEnd":312.8999996185303,"domainLookupStart":312.8999996185303,"fetchStart":312.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":312.8999996185303,"responseEnd":958.2999992370605,"responseStart":958.2999992370605,"secureConnectionStart":312.8999996185303},{"duration":645.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":313,"connectEnd":313,"connectStart":313,"domainLookupEnd":313,"domainLookupStart":313,"fetchStart":313,"redirectEnd":0,"redirectStart":0,"requestStart":313,"responseEnd":958.8999996185303,"responseStart":958.8999996185303,"secureConnectionStart":313},{"duration":646.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":313.19999980926514,"connectEnd":313.19999980926514,"connectStart":313.19999980926514,"domainLookupEnd":313.19999980926514,"domainLookupStart":313.19999980926514,"fetchStart":313.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":313.19999980926514,"responseEnd":959.5,"responseStart":959.5,"secureConnectionStart":313.19999980926514},{"duration":765.0999994277954,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":313.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":313.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1078.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":646.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":313.5999994277954,"connectEnd":313.5999994277954,"connectStart":313.5999994277954,"domainLookupEnd":313.5999994277954,"domainLookupStart":313.5999994277954,"fetchStart":313.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":313.5999994277954,"responseEnd":960,"responseStart":960,"secureConnectionStart":313.5999994277954},{"duration":765.1000003814697,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":313.79999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":313.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1078.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":646.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":313.8999996185303,"connectEnd":313.8999996185303,"connectStart":313.8999996185303,"domainLookupEnd":313.8999996185303,"domainLookupStart":313.8999996185303,"fetchStart":313.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":313.8999996185303,"responseEnd":960.7999992370605,"responseStart":960.7999992370605,"secureConnectionStart":313.8999996185303},{"duration":1260.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":314.8999996185303,"connectEnd":314.8999996185303,"connectStart":314.8999996185303,"domainLookupEnd":314.8999996185303,"domainLookupStart":314.8999996185303,"fetchStart":314.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":314.8999996185303,"responseEnd":1575.7999992370605,"responseStart":1575.7999992370605,"secureConnectionStart":314.8999996185303},{"duration":1259.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":320.5,"connectEnd":320.5,"connectStart":320.5,"domainLookupEnd":320.5,"domainLookupStart":320.5,"fetchStart":320.5,"redirectEnd":0,"redirectStart":0,"requestStart":320.5,"responseEnd":1580.3999996185303,"responseStart":1580.3999996185303,"secureConnectionStart":320.5},{"duration":476.20000076293945,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1100.2999992370605,"connectEnd":1100.2999992370605,"connectStart":1100.2999992370605,"domainLookupEnd":1100.2999992370605,"domainLookupStart":1100.2999992370605,"fetchStart":1100.2999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":1100.2999992370605,"responseEnd":1576.5,"responseStart":1576.5,"secureConnectionStart":1100.2999992370605},{"duration":185.70000076293945,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1420.7999992370605,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1420.7999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1606.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":106,"responseStart":306,"responseEnd":313,"domLoading":309,"domInteractive":1735,"domContentLoadedEventStart":1735,"domContentLoadedEventEnd":1800,"domComplete":2242,"loadEventStart":2242,"loadEventEnd":2243,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1672.7999992370605},{"name":"bigPipe.sidebar-id.end","time":1673.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1673.7999992370605},{"name":"bigPipe.activity-panel-pipe-id.end","time":1678.0999994277954},{"name":"activityTabFullyLoaded","time":1821.3999996185303}],"measures":[],"correlationId":"b4baf76210ae77","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":122,"dbReadsTimeInMs":12,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I finally found out where the information on the file name is lost. It is in deferred_spaces.add():
auto d= defers.begin();
{
++d;
// …
recv_spaces_t::iterator it{recv_spaces.find(d->first)};
it->second.name == d->second.file_name)
defers.erase(d++);
This assumption will obviously be violated when preparing a backup where tables by the same name have been created, renamed, and dropped. The input that produced data.tar.xz
involved several CREATE TABLE in one schema, RENAME TABLE to another schema, and DROP SCHEMA cool_down, in a loop.