Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.5.2 , 10.6.0 , 10.5 , 10.6 , 10.7(EOL) , 10.8(EOL) , 10.9(EOL) , 10.10(EOL)
mleich provided rr replay traces where mariadb-backup --prepare fails like this:
10.6 92032499874259bae7455130958ea7f38c4d53a3
2022-08-31 9:06:55 0 [Note] InnoDB: Starting final batch to recover 241 pages from redo log.
2022-08-31 9:06:58 0 [ERROR] InnoDB: OPT_PAGE_CHECKSUM mismatch on [page id: space=0, page number=514]
2022-08-31 9:06:58 0 [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore corruption.
2022-08-31 9:06:58 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=0, page number=514]; set innodb_force_recovery to ignore
2022-08-31 9:06:58 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1490] with error Data structure corruption
I extracted a copy of the page both from the backup and from the server at the logical point of time when the OPT_PAGE_CHECKSUM record was written. Apart from FIL_PAGE_LSN which is excluded from the checksum, the pages differ as follows:
@@ -38,7 +38,7 @@
0004e0 20 20 20 20 20 20 20 20 00 00 00 00 00 00 00 00
0004f0 01 01 00 00 00 00 00 00 00 00 00 f0 3f 00 00 00
000500 00 00 00 f0 3f 03 01 30 00 3c fb 73 00 00 00 00
-000510 00 00 00 00 07 0a 8b 00 00 01 46 0d 17 00 00 00
+000510 00 00 00 00 06 0a 8b 00 00 01 46 0d 17 00 00 00
000520 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
000530 00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
000540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
The difference is for a clustered index leaf page record that starts at 0x50c. The DB_TRX_ID=0x70a would be incorrectly recovered as 0x60a . This difference was caught thanks to MDEV-18976 .
The columns of the index seem to be something like the following:
(id INT UNSIGNED NOT NULL, DB_TRX_ID, DB_ROLL_PTR, pad CHAR(60), c CHAR(120), k INT, geocol2 GEOMETRY, tcol CHAR(3)).
On recovery, the incorrect byte was recovered by the following:
10.6 92032499874259bae7455130958ea7f38c4d53a3
(rr) frame 2
#2 0x000055f5b96c8359 in page_apply_insert_dynamic (block=..., reuse=false,
prev=0, shift=0, enc_hdr_l=23, hdr_c=0, data_c=9, data=0x4e0c52e6e807,
data_len=212)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/page/page0cur.cc:2838
2838 memcpy(buf, prev_rec, data_c);
The buf starts at 0x50c (the start of the first column), and the prev_rec at offset 0x63 contains the following:
(rr) p/x *prev_rec@data_c
$12 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6}
It is worth noting that right after the incorrect data had been copied, that prev_rec field would have been adjusted to the correct value:
#0 mach_write_to_1 (b=0x4e0c5298806b "\a", n=7)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/include/mach0data.inl:45
#1 0x000055f5b96b4204 in rec_set_bit_field_1 (rec=0x4e0c52988070 "", val=7,
offs=5, mask=15, shift=0)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/include/rem0rec.inl:159
#2 0x000055f5b96c83ab in page_apply_insert_dynamic (block=..., reuse=false,
prev=0, shift=0, enc_hdr_l=23, hdr_c=0, data_c=9, data=0x4e0c52e6e807,
data_len=212)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/page/page0cur.cc:2842
…
(rr) frame 2
#2 0x000055f5b96c83ab in page_apply_insert_dynamic (block=..., reuse=false,
prev=0, shift=0, enc_hdr_l=23, hdr_c=0, data_c=9, data=0x4e0c52e6e807,
data_len=212)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/page/page0cur.cc:2842
2842 rec_set_bit_field_1(owner_rec, n_owned + 1, REC_NEW_N_OWNED,
Offset 0x63 is where the page infimum pseudo-record is stored. Because an instant ADD/DROP COLUMN has been executed on this table, the record will not contain the string infimum but something else (NUL bytes followed by the header of the supremum record).
I think that we must ‘pessimize’ the implementation of MDEV-21724 and never write log that would copy something from the infimum record to the first actual user record in the table.
Marko Mäkelä
made changes -
2022-09-01 09:03
Status
Open
[ 1
]
In Progress
[ 3
]
Marko Mäkelä
made changes -
2022-09-01 09:53
Summary
Recovery or backup of INSERT may still be incorrect
Recovery or backup of instant ALTER TABLE is incorrect
Marko Mäkelä
made changes -
2022-09-05 07:32
issue.field.resolutiondate
2022-09-05 07:32:26.0
2022-09-05 07:32:26.227
Marko Mäkelä
made changes -
2022-09-05 07:32
Fix Version/s
10.5.18
[ 28421
]
Fix Version/s
10.6.10
[ 28407
]
Fix Version/s
10.7.6
[ 28408
]
Fix Version/s
10.8.5
[ 28308
]
Fix Version/s
10.9.3
[ 28409
]
Fix Version/s
10.10.2
[ 28410
]
Fix Version/s
10.5
[ 23123
]
Fix Version/s
10.6
[ 24028
]
Fix Version/s
10.7
[ 24805
]
Fix Version/s
10.8
[ 26121
]
Fix Version/s
10.9
[ 26905
]
Fix Version/s
10.10
[ 27530
]
Resolution
Fixed
[ 1
]
Status
In Progress
[ 3
]
Closed
[ 6
]
{"report":{"fcp":2631.5,"ttfb":1298.6000000238419,"pageVisibility":"visible","entityId":114380,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"2a3b6ae3-40c3-4e36-b73f-1f3bf194a9d7","navigationType":0,"readyForUser":2842.399999976158,"redirectCount":0,"resourceLoadedEnd":3308.600000023842,"resourceLoadedStart":1321.5,"resourceTiming":[{"duration":596.3000000715256,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":1321.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1321.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1917.8000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":596.3999999761581,"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":1321.8000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1321.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1918.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":689.6000000238419,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":1322.1000000238419,"connectEnd":1322.1000000238419,"connectStart":1322.1000000238419,"domainLookupEnd":1322.1000000238419,"domainLookupStart":1322.1000000238419,"fetchStart":1322.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":1322.1000000238419,"responseEnd":2011.7000000476837,"responseStart":2011.7000000476837,"secureConnectionStart":1322.1000000238419},{"duration":810.6000000238419,"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":1322.2000000476837,"connectEnd":1322.2000000476837,"connectStart":1322.2000000476837,"domainLookupEnd":1322.2000000476837,"domainLookupStart":1322.2000000476837,"fetchStart":1322.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1322.2000000476837,"responseEnd":2132.8000000715256,"responseStart":2132.8000000715256,"secureConnectionStart":1322.2000000476837},{"duration":859.6000000238419,"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":1322.5,"connectEnd":1322.5,"connectStart":1322.5,"domainLookupEnd":1322.5,"domainLookupStart":1322.5,"fetchStart":1322.5,"redirectEnd":0,"redirectStart":0,"requestStart":1322.5,"responseEnd":2182.100000023842,"responseStart":2182.100000023842,"secureConnectionStart":1322.5},{"duration":862.6000000238419,"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":1322.7000000476837,"connectEnd":1322.7000000476837,"connectStart":1322.7000000476837,"domainLookupEnd":1322.7000000476837,"domainLookupStart":1322.7000000476837,"fetchStart":1322.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1322.7000000476837,"responseEnd":2185.3000000715256,"responseStart":2185.3000000715256,"secureConnectionStart":1322.7000000476837},{"duration":886.6000000238419,"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":1325,"connectEnd":1325,"connectStart":1325,"domainLookupEnd":1325,"domainLookupStart":1325,"fetchStart":1325,"redirectEnd":0,"redirectStart":0,"requestStart":1325,"responseEnd":2211.600000023842,"responseStart":2211.600000023842,"secureConnectionStart":1325},{"duration":917.3999999761581,"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":1325.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1325.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2242.600000023842,"responseStart":0,"secureConnectionStart":0},{"duration":912.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":1325.3999999761581,"connectEnd":1325.3999999761581,"connectStart":1325.3999999761581,"domainLookupEnd":1325.3999999761581,"domainLookupStart":1325.3999999761581,"fetchStart":1325.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":1325.3999999761581,"responseEnd":2238.100000023842,"responseStart":2238,"secureConnectionStart":1325.3999999761581},{"duration":937.6000000238419,"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":1326.3999999761581,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1326.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2264,"responseStart":0,"secureConnectionStart":0},{"duration":938.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":1326.6000000238419,"connectEnd":1326.6000000238419,"connectStart":1326.6000000238419,"domainLookupEnd":1326.6000000238419,"domainLookupStart":1326.6000000238419,"fetchStart":1326.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":1326.6000000238419,"responseEnd":2264.8000000715256,"responseStart":2264.8000000715256,"secureConnectionStart":1326.6000000238419},{"duration":1120.6000000238419,"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":1328.7000000476837,"connectEnd":1328.7000000476837,"connectStart":1328.7000000476837,"domainLookupEnd":1328.7000000476837,"domainLookupStart":1328.7000000476837,"fetchStart":1328.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1328.7000000476837,"responseEnd":2449.3000000715256,"responseStart":2449.3000000715256,"secureConnectionStart":1328.7000000476837},{"duration":1976.1999999284744,"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":1328.8000000715256,"connectEnd":1328.8000000715256,"connectStart":1328.8000000715256,"domainLookupEnd":1328.8000000715256,"domainLookupStart":1328.8000000715256,"fetchStart":1328.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":1328.8000000715256,"responseEnd":3305,"responseStart":3305,"secureConnectionStart":1328.8000000715256},{"duration":175.89999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":2257,"connectEnd":2257,"connectStart":2257,"domainLookupEnd":2257,"domainLookupStart":2257,"fetchStart":2257,"redirectEnd":0,"redirectStart":0,"requestStart":2257,"responseEnd":2432.899999976158,"responseStart":2432.899999976158,"secureConnectionStart":2257},{"duration":761.5,"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":2544.3000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2544.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":3305.8000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":760.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":2545.3000000715256,"connectEnd":2545.3000000715256,"connectStart":2545.3000000715256,"domainLookupEnd":2545.3000000715256,"domainLookupStart":2545.3000000715256,"fetchStart":2545.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":2545.3000000715256,"responseEnd":3306.100000023842,"responseStart":3306.100000023842,"secureConnectionStart":2545.3000000715256},{"duration":762.8999999761581,"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":2545.7000000476837,"connectEnd":2545.7000000476837,"connectStart":2545.7000000476837,"domainLookupEnd":2545.7000000476837,"domainLookupStart":2545.7000000476837,"fetchStart":2545.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":2545.7000000476837,"responseEnd":3308.600000023842,"responseStart":3308.600000023842,"secureConnectionStart":2545.7000000476837},{"duration":715.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":2618.600000023842,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2618.600000023842,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":3334.100000023842,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":1033,"responseStart":1299,"responseEnd":1315,"domLoading":1318,"domInteractive":3344,"domContentLoadedEventStart":3344,"domContentLoadedEventEnd":3405,"domComplete":3880,"loadEventStart":3880,"loadEventEnd":3881,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":3314.100000023842},{"name":"bigPipe.sidebar-id.end","time":3315},{"name":"bigPipe.activity-panel-pipe-id.start","time":3315.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":3318.5},{"name":"activityTabFullyLoaded","time":3433.8000000715256}],"measures":[],"correlationId":"a8614b93843121","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":199,"dbReadsTimeInMs":31,"dbConnsTimeInMs":44,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}