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:
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,
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.
Attachments
Issue Links
causes
MDEV-29471Buffer overflow in page_cur_insert_rec_low()
order=0x0, ignore=false, if_exists=false) at /data/Server/bb-10.6-MDEV-29374/sql/sql_table.cc:10278
#12 0x00005572f9b74c76 in Sql_cmd_alter_table::execute (this=0x62b000118ce8, thd=0x62b000149218) at /data/Server/bb-10.6-MDEV-29374/sql/sql_alter.cc:542
#13 0x00005572f9774c79 in mysql_execute_command (thd=0x62b000149218, is_called_from_prepared_stmt=false) at /data/Server/bb-10.6-MDEV-29374/sql/sql_parse.cc:5997
#14 0x00005572f9781046 in mysql_parse (thd=0x62b000149218, rawbuf=0x62b000118238 "ALTER TABLE t18 ADD COLUMN IF NOT EXISTS tcol7 TIME DEFAULT NULL FIRST, LOCK=SHARED /* E_R Thread2 QNO 2036 CON_ID 19 */",
length=120, parser_state=0x58551c4fba20) at /data/Server/bb-10.6-MDEV-29374/sql/sql_parse.cc:8030
The ADD COLUMN…FIRST will cause columns to be reordered in the table.
For reproducing this bug, I think that it is important that the table contains INT UNSIGNED PRIMARY KEY. Execute something like this in a loop, and concurrently run backup and restore:
CREATETABLE t(a INT UNSIGNED PRIMARYKEY) ENGINE=InnoDB;
INSERTINTO t VALUES …;
ALTERTABLE t ADDCOLUMN b INTNULLFIRST;
DROPTABLE t;
Marko Mäkelä
added a comment - The infimum and supremum strings were repurposed in MDEV-15562 .
The insert of the record that is logged incorrectly is actually for the hidden metadata record of a MDEV-15562 operation:
10.6 92032499874259bae7455130958ea7f38c4d53a3
#2 0x00005572faaadca1 in page_cur_insert_rec_low (cur=0x58551c4f5048, index=0x616006e1a608, rec=0x6140000254cf "", offsets=0x58551c4f5170, mtr=0x58551c4f5450)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/page/page0cur.cc:1525
#3 0x00005572fad90d7d in page_cur_tuple_insert (cursor=0x58551c4f5048, tuple=0x61d0009f1e88, index=0x616006e1a608, offsets=0x58551c4f5000, heap=0x58551c4f4fe0, n_ext=1, mtr=0x58551c4f5450)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/include/page0cur.inl:199
#4 0x00005572fada7631 in btr_cur_optimistic_insert (flags=2, cursor=0x58551c4f5040, offsets=0x58551c4f5000, heap=0x58551c4f4fe0, entry=0x61d0009f1e88, rec=0x58551c4f5020, big_rec=0x58551c4f4fc0, n_ext=1,
thr=0x61d0009f2070, mtr=0x58551c4f5450) at /data/Server/bb-10.6-MDEV-29374/storage/innobase/btr/btr0cur.cc:3500
#5 0x00005572fab90ae2 in row_ins_clust_index_entry_low (flags=2, mode=10, index=0x616006e1a608, n_uniq=1, entry=0x61d0009f1e88, n_ext=0, thr=0x61d0009f2070)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/row/row0ins.cc:2764
#6 0x00005572fa8dcfcd in innobase_instant_try (ha_alter_info=0x58551c4f7a90, ctx=0x62b00011aad0, altered_table=0x58551c4f8190, table=0x619001cea398, trx=0x75cd11101440)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/handler/handler0alter.cc:6177
#7 0x00005572fa92d529 in commit_try_norebuild (ha_alter_info=0x58551c4f7a90, ctx=0x62b00011aad0, altered_table=0x58551c4f8190, old_table=0x619001cea398, trx=0x75cd11101440, table_name=0x61b000092155 "t18")
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/handler/handler0alter.cc:10559
#8 0x00005572fa905753 in ha_innobase::commit_inplace_alter_table (this=0x61d000885eb8, altered_table=0x58551c4f8190, ha_alter_info=0x58551c4f7a90, commit=true)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/handler/handler0alter.cc:11308
#9 0x00005572f9f5c304 in handler::ha_commit_inplace_alter_table (this=0x61d000885eb8, altered_table=0x58551c4f8190, ha_alter_info=0x58551c4f7a90, commit=true)
at /data/Server/bb-10.6-MDEV-29374/sql/handler.cc:5234
#10 0x00005572f99d192a in mysql_inplace_alter_table (thd=0x62b000149218, table_list=0x62b000118400, table=0x619001cea398, altered_table=0x58551c4f8190, ha_alter_info=0x58551c4f7a90,
target_mdl_request=0x58551c4f7b90, ddl_log_state=0x58551c4f78b0, trigger_param=0x58551c4f8600, alter_ctx=0x58551c4f90a0) at /data/Server/bb-10.6-MDEV-29374/sql/sql_table.cc:7471
#11 0x00005572f99e55b6 in mysql_alter_table (thd=0x62b000149218, new_db=0x62b00014dc18, new_name=0x62b00014e030, create_info=0x58551c4fa550, table_list=0x62b000118400, alter_info=0x58551c4fa420, order_num=0,
order=0x0, ignore=false, if_exists=false) at /data/Server/bb-10.6-MDEV-29374/sql/sql_table.cc:10278
#12 0x00005572f9b74c76 in Sql_cmd_alter_table::execute (this=0x62b000118ce8, thd=0x62b000149218) at /data/Server/bb-10.6-MDEV-29374/sql/sql_alter.cc:542
#13 0x00005572f9774c79 in mysql_execute_command (thd=0x62b000149218, is_called_from_prepared_stmt=false) at /data/Server/bb-10.6-MDEV-29374/sql/sql_parse.cc:5997
#14 0x00005572f9781046 in mysql_parse (thd=0x62b000149218, rawbuf=0x62b000118238 "ALTER TABLE t18 ADD COLUMN IF NOT EXISTS tcol7 TIME DEFAULT NULL FIRST, LOCK=SHARED /* E_R Thread2 QNO 2036 CON_ID 19 */",
length=120, parser_state=0x58551c4fba20) at /data/Server/bb-10.6-MDEV-29374/sql/sql_parse.cc:8030
The ADD COLUMN…FIRST will cause columns to be reordered in the table.
For reproducing this bug, I think that it is important that the table contains INT UNSIGNED PRIMARY KEY . Execute something like this in a loop, and concurrently run backup and restore:
CREATE TABLE t(a INT UNSIGNED PRIMARY KEY ) ENGINE=InnoDB;
INSERT INTO t VALUES …;
ALTER TABLE t ADD COLUMN b INT NULL FIRST ;
DROP TABLE t;
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=0, page number=243]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Failed to read page 243 from file './ibdata1': Page read from tablespace is corrupted.
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=1, page number=3]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Failed to read page 3 from file './mysql/innodb_table_stats.ibd': Page read from tablespace is corrupted.
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=2, page number=3]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Failed to read page 3 from file './mysql/innodb_index_stats.ibd': Page read from tablespace is corrupted.
2022-09-01 15:50:35 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-09-01 15:50:35 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
I may have accidentally reproduced another bug in multi-batch recovery, because I only expected that single page to be corrupted.
Marko Mäkelä
added a comment - Finally, I reproduced this without hitting MDEV-29440 . The UPDATE loop is for incrementing the DB_TRX_ID to a suitable range.
--source include/have_innodb.inc
--source include/not_embedded.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
CREATE TABLE t1(a INT PRIMARY KEY ) ENGINE=InnoDB;
INSERT INTO t1 SET a=1;
--disable_query_log
let $N=768;
while ($N) {
UPDATE t1 SET a=a+1;
dec $N;
}
--enable_query_log
CREATE TABLE t2(a INT UNSIGNED PRIMARY KEY , b INT NOT NULL DEFAULT 42)
ENGINE=InnoDB;
INSERT INTO t2 (a) VALUES (1),(2),(3),(4);
connect ddl, localhost, root;
SET DEBUG_SYNC= 'innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever' ;
--send
ALTER TABLE t2 MODIFY COLUMN b INT NOT NULL DEFAULT 42 FIRST ;
connection default ;
SET DEBUG_SYNC= 'now WAIT_FOR ddl' ;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
DELETE FROM t1;
--source include/kill_mysqld.inc
disconnect ddl;
--source include/start_mysqld.inc
CHECK TABLE t2;
DROP TABLE t1,t2;
10.6 40aa94df356cfa000fc43c92ff0061212d1b161d
2022-09-01 15:50:35 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=54849,54849
2022-09-01 15:50:35 0 [ERROR] InnoDB: OPT_PAGE_CHECKSUM mismatch on [page id: space=6, page number=3]
2022-09-01 15:50:35 0 [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore corruption.
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=6, page number=3]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 6 row operations to undo
2022-09-01 15:50:35 0 [Note] InnoDB: Trx id counter is 1574
2022-09-01 15:50:35 0 [Note] InnoDB: Starting final batch to recover 12 pages from redo log.
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=0, page number=324]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=0, page number=410]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=0, page number=0]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Failed to read page 0 from file './ibdata1': Page read from tablespace is corrupted.
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=5, page number=1]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=5, page number=2]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=5, page number=3]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=6, page number=1]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=6, page number=2]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=6, page number=4]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [Note] InnoDB: Set innodb_force_recovery=1 to ignore corrupted pages.
2022-09-01 15:50:35 0 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[1490] with error Data structure corruption
2022-09-01 15:50:35 0 [Note] InnoDB: Starting shutdown...
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=0, page number=243]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Failed to read page 243 from file './ibdata1': Page read from tablespace is corrupted.
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=1, page number=3]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Failed to read page 3 from file './mysql/innodb_table_stats.ibd': Page read from tablespace is corrupted.
2022-09-01 15:50:35 0 [ERROR] InnoDB: Unable to apply log to corrupted page [page id: space=2, page number=3]; set innodb_force_recovery to ignore
2022-09-01 15:50:35 0 [ERROR] InnoDB: Failed to read page 3 from file './mysql/innodb_index_stats.ibd': Page read from tablespace is corrupted.
2022-09-01 15:50:35 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-09-01 15:50:35 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
I may have accidentally reproduced another bug in multi-batch recovery, because I only expected that single page to be corrupted.
That is, we would hit MDEV-29440 a little later (this time during innodb_check_version(), invoked by ddl_log_execute_recovery()). I double-checked that without the fix, we will get many ‘extra’ messages for the unrelated pages.
Marko Mäkelä
added a comment - With the following fix, there will be no log apply failure messages:
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc
index 5f7192675dc..3f863d36a3a 100644
--- a/storage/innobase/page/page0cur.cc
+++ b/storage/innobase/page/page0cur.cc
@@ -1648,7 +1648,7 @@ page_cur_insert_rec_low(
{
const byte *r= rec;
const byte *c= cur->rec;
- const byte *c_end= cur->rec + data_size;
+ const byte *c_end= c + (page_rec_is_infimum(c) ? 8 : data_size);
static_assert(REC_N_OLD_EXTRA_BYTES == REC_N_NEW_EXTRA_BYTES + 1, "");
if (c <= insert_buf && c_end > insert_buf)
c_end= insert_buf;
10.6 40aa94df356cfa000fc43c92ff0061212d1b161d with the patch
2022-09-01 16:25:13 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=54849,54849
2022-09-01 16:25:13 0 [ERROR] InnoDB: Table `test`.`t2` contains unrecognizable instant ALTER metadata
2022-09-01 16:25:13 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 6 row operations to undo
2022-09-01 16:25:13 0 [Note] InnoDB: Trx id counter is 1574
2022-09-01 16:25:13 0 [Note] InnoDB: Starting final batch to recover 13 pages from redo log.
2022-09-01 16:25:13 0 [Note] InnoDB: 128 rollback segments are active.
2022-09-01 16:25:13 0 [Note] InnoDB: Rolled back recovered transaction 1571
…
2022-09-01 16:25:13 0 [ERROR] InnoDB: Table `test`.`t2` contains unrecognizable instant ALTER metadata
mariadbd: /mariadb/10.6/storage/innobase/dict/dict0load.cc:2464: dict_table_t* dict_load_table_one(const st_::span<const char>&, dict_err_ignore_t, dict_names_t&): Assertion `!table || (ignore_err & ~DICT_ERR_IGNORE_FK_NOKEY) || !table->is_readable() || !table->corrupted' failed.
That is, we would hit MDEV-29440 a little later (this time during innodb_check_version() , invoked by ddl_log_execute_recovery() ). I double-checked that without the fix, we will get many ‘extra’ messages for the unrelated pages.
The reason for the flood of messages for unrelated pages is the following in log_phys_t::apply():
case OPTION:
ut_ad(rlen == 5);
ut_ad(*l == OPT_PAGE_CHECKSUM);
if (page_checksum(block, l + 1))
{
applied= APPLIED_YES;
page_corrupted:
sql_print_error("InnoDB: Set innodb_force_recovery=1"
" to ignore corruption.");
recv_sys.set_corrupt_log();
return applied;
}
We are flagging the log corrupted only because a single page is corrupted. This will cause all subsequent invocations of recv_recover_page() to evict pages as corrupted:
set_start_lsn:
if (recv_sys.is_corrupt_log() && !srv_force_recovery) {
…
buf_pool.corrupted_evict(&block->page,
block->page.state() &
buf_page_t::LRU_MASK);
It would be better to introduce another return value, say, log_phys_t::APPLIED_CORRUPTED, to indicate that the page was corrupted. Then there would be no ‘collateral damage’ of claiming unrelated pages as corrupted. The recv_sys.set_corrupt_log() must be reserved to cases where the entire log is corrupted.
Marko Mäkelä
added a comment - The reason for the flood of messages for unrelated pages is the following in log_phys_t::apply() :
case OPTION:
ut_ad(rlen == 5);
ut_ad(*l == OPT_PAGE_CHECKSUM);
if (page_checksum(block, l + 1))
{
applied= APPLIED_YES;
page_corrupted:
sql_print_error( "InnoDB: Set innodb_force_recovery=1"
" to ignore corruption." );
recv_sys.set_corrupt_log();
return applied;
}
We are flagging the log corrupted only because a single page is corrupted. This will cause all subsequent invocations of recv_recover_page() to evict pages as corrupted:
set_start_lsn:
if (recv_sys.is_corrupt_log() && !srv_force_recovery) {
…
buf_pool.corrupted_evict(&block->page,
block->page.state() &
buf_page_t::LRU_MASK);
It would be better to introduce another return value, say, log_phys_t::APPLIED_CORRUPTED , to indicate that the page was corrupted. Then there would be no ‘collateral damage’ of claiming unrelated pages as corrupted. The recv_sys.set_corrupt_log() must be reserved to cases where the entire log is corrupted.
I think that this bug should also affect normal tables where the string infimum is being inserted in the first PRIMARY KEY column as the first record of the table, but I was unable to repeat an OPT_PAGE_CHECKSUM mismatch in such a case.
In 10.5, recovery would not invoke buf_pool.corrupted_evict() if it fails to apply some log to a page. That code was added to 10.6.9 in MDEV-13542.
Marko Mäkelä
added a comment - I think that this bug should also affect normal tables where the string infimum is being inserted in the first PRIMARY KEY column as the first record of the table, but I was unable to repeat an OPT_PAGE_CHECKSUM mismatch in such a case.
In 10.5, recovery would not invoke buf_pool.corrupted_evict() if it fails to apply some log to a page. That code was added to 10.6.9 in MDEV-13542 .
People
Marko Mäkelä
Marko Mäkelä
Votes:
0Vote for this issue
Watchers:
3Start 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":1593.5999999046326,"ttfb":321.2999997138977,"pageVisibility":"visible","entityId":114380,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"d94b967b-ae53-447d-a9d9-fa17a3b7b9a5","navigationType":0,"readyForUser":1727.7999997138977,"redirectCount":0,"resourceLoadedEnd":920.5,"resourceLoadedStart":330.40000009536743,"resourceTiming":[{"duration":156.89999961853027,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":330.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":330.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":487.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":156.90000009536743,"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":330.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":330.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":487.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":441.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":330.90000009536743,"connectEnd":330.90000009536743,"connectStart":330.90000009536743,"domainLookupEnd":330.90000009536743,"domainLookupStart":330.90000009536743,"fetchStart":330.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":508.2999997138977,"responseEnd":772.4000000953674,"responseStart":550,"secureConnectionStart":330.90000009536743},{"duration":589.5,"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":331,"connectEnd":331,"connectStart":331,"domainLookupEnd":331,"domainLookupStart":331,"fetchStart":331,"redirectEnd":0,"redirectStart":0,"requestStart":508.5,"responseEnd":920.5,"responseStart":553.5,"secureConnectionStart":331},{"duration":232.7000002861023,"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":331.2999997138977,"connectEnd":331.2999997138977,"connectStart":331.2999997138977,"domainLookupEnd":331.2999997138977,"domainLookupStart":331.2999997138977,"fetchStart":331.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":508.59999990463257,"responseEnd":564,"responseStart":555.0999999046326,"secureConnectionStart":331.2999997138977},{"duration":235.09999990463257,"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":331.40000009536743,"connectEnd":331.40000009536743,"connectStart":331.40000009536743,"domainLookupEnd":331.40000009536743,"domainLookupStart":331.40000009536743,"fetchStart":331.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":508.69999980926514,"responseEnd":566.5,"responseStart":557.1999998092651,"secureConnectionStart":331.40000009536743},{"duration":236.59999990463257,"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":331.59999990463257,"connectEnd":331.59999990463257,"connectStart":331.59999990463257,"domainLookupEnd":331.59999990463257,"domainLookupStart":331.59999990463257,"fetchStart":331.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":508.7999997138977,"responseEnd":568.1999998092651,"responseStart":559.1999998092651,"secureConnectionStart":331.59999990463257},{"duration":165.5,"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":331.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":331.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":497.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":236.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":332,"connectEnd":332,"connectStart":332,"domainLookupEnd":332,"domainLookupStart":332,"fetchStart":332,"redirectEnd":0,"redirectStart":0,"requestStart":509,"responseEnd":568.4000000953674,"responseStart":560.9000000953674,"secureConnectionStart":332},{"duration":166.09999990463257,"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":332.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":332.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":498.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":236.59999990463257,"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":332.40000009536743,"connectEnd":332.40000009536743,"connectStart":332.40000009536743,"domainLookupEnd":332.40000009536743,"domainLookupStart":332.40000009536743,"fetchStart":332.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":509.09999990463257,"responseEnd":569,"responseStart":561.6999998092651,"secureConnectionStart":332.40000009536743},{"duration":579.8000001907349,"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":333.59999990463257,"connectEnd":333.59999990463257,"connectStart":333.59999990463257,"domainLookupEnd":333.59999990463257,"domainLookupStart":333.59999990463257,"fetchStart":333.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":609,"responseEnd":913.4000000953674,"responseStart":904.5999999046326,"secureConnectionStart":333.59999990463257},{"duration":575.2000002861023,"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":339.69999980926514,"connectEnd":339.69999980926514,"connectStart":339.69999980926514,"domainLookupEnd":339.69999980926514,"domainLookupStart":339.69999980926514,"fetchStart":339.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":676.7999997138977,"responseEnd":914.9000000953674,"responseStart":907.5,"secureConnectionStart":339.69999980926514},{"duration":226.7999997138977,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":977.4000000953674,"connectEnd":977.4000000953674,"connectStart":977.4000000953674,"domainLookupEnd":977.4000000953674,"domainLookupStart":977.4000000953674,"fetchStart":977.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1169.4000000953674,"responseEnd":1204.1999998092651,"responseStart":1200.6999998092651,"secureConnectionStart":977.4000000953674}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":109,"responseStart":321,"responseEnd":331,"domLoading":328,"domInteractive":1831,"domContentLoadedEventStart":1832,"domContentLoadedEventEnd":1903,"domComplete":2657,"loadEventStart":2657,"loadEventEnd":2658,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1780.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1781.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1781.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":1789.2999997138977},{"name":"activityTabFullyLoaded","time":1922.6999998092651}],"measures":[],"correlationId":"51e3998b224cf6","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":130,"dbReadsTimeInMs":18,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The infimum and supremum strings were repurposed in
MDEV-15562.The insert of the record that is logged incorrectly is actually for the hidden metadata record of a
MDEV-15562operation:10.6 92032499874259bae7455130958ea7f38c4d53a3
#2 0x00005572faaadca1 in page_cur_insert_rec_low (cur=0x58551c4f5048, index=0x616006e1a608, rec=0x6140000254cf "", offsets=0x58551c4f5170, mtr=0x58551c4f5450)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/page/page0cur.cc:1525
#3 0x00005572fad90d7d in page_cur_tuple_insert (cursor=0x58551c4f5048, tuple=0x61d0009f1e88, index=0x616006e1a608, offsets=0x58551c4f5000, heap=0x58551c4f4fe0, n_ext=1, mtr=0x58551c4f5450)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/include/page0cur.inl:199
#4 0x00005572fada7631 in btr_cur_optimistic_insert (flags=2, cursor=0x58551c4f5040, offsets=0x58551c4f5000, heap=0x58551c4f4fe0, entry=0x61d0009f1e88, rec=0x58551c4f5020, big_rec=0x58551c4f4fc0, n_ext=1,
thr=0x61d0009f2070, mtr=0x58551c4f5450) at /data/Server/bb-10.6-MDEV-29374/storage/innobase/btr/btr0cur.cc:3500
#5 0x00005572fab90ae2 in row_ins_clust_index_entry_low (flags=2, mode=10, index=0x616006e1a608, n_uniq=1, entry=0x61d0009f1e88, n_ext=0, thr=0x61d0009f2070)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/row/row0ins.cc:2764
#6 0x00005572fa8dcfcd in innobase_instant_try (ha_alter_info=0x58551c4f7a90, ctx=0x62b00011aad0, altered_table=0x58551c4f8190, table=0x619001cea398, trx=0x75cd11101440)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/handler/handler0alter.cc:6177
#7 0x00005572fa92d529 in commit_try_norebuild (ha_alter_info=0x58551c4f7a90, ctx=0x62b00011aad0, altered_table=0x58551c4f8190, old_table=0x619001cea398, trx=0x75cd11101440, table_name=0x61b000092155 "t18")
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/handler/handler0alter.cc:10559
#8 0x00005572fa905753 in ha_innobase::commit_inplace_alter_table (this=0x61d000885eb8, altered_table=0x58551c4f8190, ha_alter_info=0x58551c4f7a90, commit=true)
at /data/Server/bb-10.6-MDEV-29374/storage/innobase/handler/handler0alter.cc:11308
#9 0x00005572f9f5c304 in handler::ha_commit_inplace_alter_table (this=0x61d000885eb8, altered_table=0x58551c4f8190, ha_alter_info=0x58551c4f7a90, commit=true)
at /data/Server/bb-10.6-MDEV-29374/sql/handler.cc:5234
#10 0x00005572f99d192a in mysql_inplace_alter_table (thd=0x62b000149218, table_list=0x62b000118400, table=0x619001cea398, altered_table=0x58551c4f8190, ha_alter_info=0x58551c4f7a90,
target_mdl_request=0x58551c4f7b90, ddl_log_state=0x58551c4f78b0, trigger_param=0x58551c4f8600, alter_ctx=0x58551c4f90a0) at /data/Server/bb-10.6-MDEV-29374/sql/sql_table.cc:7471
#11 0x00005572f99e55b6 in mysql_alter_table (thd=0x62b000149218, new_db=0x62b00014dc18, new_name=0x62b00014e030, create_info=0x58551c4fa550, table_list=0x62b000118400, alter_info=0x58551c4fa420, order_num=0,
order=0x0, ignore=false, if_exists=false) at /data/Server/bb-10.6-MDEV-29374/sql/sql_table.cc:10278
#12 0x00005572f9b74c76 in Sql_cmd_alter_table::execute (this=0x62b000118ce8, thd=0x62b000149218) at /data/Server/bb-10.6-MDEV-29374/sql/sql_alter.cc:542
#13 0x00005572f9774c79 in mysql_execute_command (thd=0x62b000149218, is_called_from_prepared_stmt=false) at /data/Server/bb-10.6-MDEV-29374/sql/sql_parse.cc:5997
#14 0x00005572f9781046 in mysql_parse (thd=0x62b000149218, rawbuf=0x62b000118238 "ALTER TABLE t18 ADD COLUMN IF NOT EXISTS tcol7 TIME DEFAULT NULL FIRST, LOCK=SHARED /* E_R Thread2 QNO 2036 CON_ID 19 */",
length=120, parser_state=0x58551c4fba20) at /data/Server/bb-10.6-MDEV-29374/sql/sql_parse.cc:8030
The ADD COLUMN…FIRST will cause columns to be reordered in the table.
For reproducing this bug, I think that it is important that the table contains INT UNSIGNED PRIMARY KEY. Execute something like this in a loop, and concurrently run backup and restore: