SELECT `col2` FROM `test`.`t3` FORCE INDEX (`Marvão_uidx1`) WHERE `col2` IS NULL OR `col2` IS NOT NULL harvests 1030: Got error 1 "Operation not permitted" from storage engine InnoDB.
The server error log contains for the time of the SELECT ... FORCE ...
[rr 3698310 16732]2023-09-05 7:42:03 6 [ERROR] Cannot find index Marvão_uidx1 in InnoDB index dictionary.
[rr 3698310 16736]2023-09-05 7:42:03 6 [ERROR] InnoDB indexes are inconsistent with what defined in .frm for table ./test/t3
[rr 3698310 16740]2023-09-05 7:42:03 6 [ERROR] InnoDB: Table test/t3 contains 2 indexes inside InnoDB, which is different from the number of indexes 3 defined in the .frm file. See https://mariadb.com/kb/en/innodb-troubleshooting/
3: m_user_thd.query_string = {string = {str = 0xc8264028220 "ALTER TABLE t3 ADD FULLTEXT INDEX IF NOT EXISTS `Marvão_ftidx2` ( col_text ), ADD UNIQUE KEY IF NOT EXISTS `Marvão_uidx1` ( col2 /* 100800 ASC */, col1 /* 100800 DESC */ ) /* E_R Thread2 QNO 332 CO"..., length = 210}, cs = 0x55f97b094520 <my_charset_latin1>}
Current event: 433927
Thread 47 received signal SIGKILL, Killed.
[Switching to Thread 3460236.3474134]
0x0000000070000002 in syscall_traced ()
(rr) when
Current event: 434122
It looks like the last persistent write (update of log_sys.flushed_to_disk_lsn) was some time earlier in this thread:
#6 0x000055f97a6a09e4 in trx_t::commit_persist (this=this@entry=0x1ac73ffcea80) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/trx/trx0trx.cc:1583
#7 0x000055f97a700611 in trx_t::commit (this=this@entry=0x1ac73ffcea80, deleted=std::vector of length 0, capacity 0) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/dict/drop.cc:238
#8 0x000055f97a5e50b1 in commit_unlock_and_unlink (trx=0x1ac73ffcea80) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/handler0alter.cc:4339
flags2=<optimized out>, fts_doc_id_col=<optimized out>, add_fts_doc_id=<optimized out>, add_fts_doc_id_idx=<optimized out>) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/handler0alter.cc:7352
#10 0x000055f97a5ee8e2 in ha_innobase::prepare_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>)
at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/ha_innodb.h:695
#11 0x000055f97a1d802d in mysql_inplace_alter_table (target_mdl_request=0x7f2b2f0885e0, alter_ctx=0x7f2b2f089740, trigger_param=0x7f2b2f088190, ddl_log_state=0x7f2b2f087c70, ha_alter_info=0x7f2b2f087cd0,
altered_table=0x7f2b2f087d90, table=0xc826408d4c8, table_list=0xc8264028470, thd=0xc826401dad8) at /data/Server/bb-10.6-MDEV-32068/sql/sql_table.cc:7361
The later call to ha_innobase::commit_inplace_alter_table() returned false (indicating success), while log_sys.lsn=19710260 and log_sys.flushed_to_disk_lsn=19691339 (at the value of the above write). This is definitely wrong. These values remained until the SIGKILL. Because there was no call to innodb_check_version on the subsequent server startup, I suppose that the SQL layer had replaced the .frm file and cleared the ddl_recovery.log. That subsequent recovery reported the following:
2023-09-05 7:41:50 0 [Note] InnoDB: 10.6.16 started; log sequence number 19709789; transaction id 6814
…
2023-09-05 7:42:03 6 [ERROR] Cannot find index Marvão_uidx1 in InnoDB index dictionary.
2023-09-05 7:42:03 6 [ERROR] InnoDB indexes are inconsistent with what defined in .frm for table ./test/t3
2023-09-05 7:42:03 6 [ERROR] InnoDB: Table test/t3 contains 2 indexes inside InnoDB, which is different from the number of indexes 3 defined in the .frm file. See https://mariadb.com/kb/en/innodb-troubleshooting/
I believe that this is a regression due to MDEV-30100. We must durably write the log for committing a DDL transaction.
Marko Mäkelä
added a comment - The first server instance after bootstrap executed an ALTER TABLE slightly before it was killed:
Thread 54 hit Breakpoint 2, ha_innobase::commit_inplace_alter_table (this=0xc826406c8b0, altered_table=0x7f2b2f087d90, ha_alter_info=0x7f2b2f087cd0, commit=true) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/handler0alter.cc:11093
11093 {
1: m_prebuilt.table.name = {m_name = 0x7aac48017d70 "test/t3"}
3: m_user_thd.query_string = {string = {str = 0xc8264028220 "ALTER TABLE t3 ADD FULLTEXT INDEX IF NOT EXISTS `Marvão_ftidx2` ( col_text ), ADD UNIQUE KEY IF NOT EXISTS `Marvão_uidx1` ( col2 /* 100800 ASC */, col1 /* 100800 DESC */ ) /* E_R Thread2 QNO 332 CO"..., length = 210}, cs = 0x55f97b094520 <my_charset_latin1>}
Current event: 433927
Thread 47 received signal SIGKILL, Killed.
[Switching to Thread 3460236.3474134]
0x0000000070000002 in syscall_traced ()
(rr) when
Current event: 434122
It looks like the last persistent write (update of log_sys.flushed_to_disk_lsn ) was some time earlier in this thread:
#6 0x000055f97a6a09e4 in trx_t::commit_persist (this=this@entry=0x1ac73ffcea80) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/trx/trx0trx.cc:1583
#7 0x000055f97a700611 in trx_t::commit (this=this@entry=0x1ac73ffcea80, deleted=std::vector of length 0, capacity 0) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/dict/drop.cc:238
#8 0x000055f97a5e50b1 in commit_unlock_and_unlink (trx=0x1ac73ffcea80) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/handler0alter.cc:4339
#9 0x000055f97a5ec0cc in prepare_inplace_alter_table_dict (ha_alter_info=<optimized out>, altered_table=<optimized out>, old_table=<optimized out>, table_name=<optimized out>, flags=<optimized out>,
flags2=<optimized out>, fts_doc_id_col=<optimized out>, add_fts_doc_id=<optimized out>, add_fts_doc_id_idx=<optimized out>) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/handler0alter.cc:7352
#10 0x000055f97a5ee8e2 in ha_innobase::prepare_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>)
at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/ha_innodb.h:695
#11 0x000055f97a1d802d in mysql_inplace_alter_table (target_mdl_request=0x7f2b2f0885e0, alter_ctx=0x7f2b2f089740, trigger_param=0x7f2b2f088190, ddl_log_state=0x7f2b2f087c70, ha_alter_info=0x7f2b2f087cd0,
altered_table=0x7f2b2f087d90, table=0xc826408d4c8, table_list=0xc8264028470, thd=0xc826401dad8) at /data/Server/bb-10.6-MDEV-32068/sql/sql_table.cc:7361
The later call to ha_innobase::commit_inplace_alter_table() returned false (indicating success), while log_sys.lsn=19710260 and log_sys.flushed_to_disk_lsn=19691339 (at the value of the above write). This is definitely wrong. These values remained until the SIGKILL. Because there was no call to innodb_check_version on the subsequent server startup, I suppose that the SQL layer had replaced the .frm file and cleared the ddl_recovery.log . That subsequent recovery reported the following:
2023-09-05 7:41:47 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=42486,42486
…
2023-09-05 7:41:50 0 [Note] InnoDB: 10.6.16 started; log sequence number 19709789; transaction id 6814
…
2023-09-05 7:42:03 6 [ERROR] Cannot find index Marvão_uidx1 in InnoDB index dictionary.
2023-09-05 7:42:03 6 [ERROR] InnoDB indexes are inconsistent with what defined in .frm for table ./test/t3
2023-09-05 7:42:03 6 [ERROR] InnoDB: Table test/t3 contains 2 indexes inside InnoDB, which is different from the number of indexes 3 defined in the .frm file. See https://mariadb.com/kb/en/innodb-troubleshooting/
I believe that this is a regression due to MDEV-30100 . We must durably write the log for committing a DDL transaction.
The atomic DDL commit that fails to be persisted is here:
(rr) backtrace
#0 trx_t::commit_in_memory (mtr=0x7f2b2f087610, this=0x1ac73ffcea80) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/trx/trx0trx.cc:1366
#1 trx_t::commit_low (this=0x1ac73ffcea80, mtr=0x7f2b2f087610) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/trx/trx0trx.cc:1569
#2 0x000055f97a6a09e4 in trx_t::commit_persist (this=this@entry=0x1ac73ffcea80) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/trx/trx0trx.cc:1583
#3 0x000055f97a700611 in trx_t::commit (this=this@entry=0x1ac73ffcea80, deleted=std::vector of length 0, capacity 0) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/dict/drop.cc:238
at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/handler0alter.cc:11549
…
(rr) print mtr->m_commit_lsn
$1 = 19710260
Marko Mäkelä
added a comment - The atomic DDL commit that fails to be persisted is here:
(rr) backtrace
#0 trx_t::commit_in_memory (mtr=0x7f2b2f087610, this=0x1ac73ffcea80) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/trx/trx0trx.cc:1366
#1 trx_t::commit_low (this=0x1ac73ffcea80, mtr=0x7f2b2f087610) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/trx/trx0trx.cc:1569
#2 0x000055f97a6a09e4 in trx_t::commit_persist (this=this@entry=0x1ac73ffcea80) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/trx/trx0trx.cc:1583
#3 0x000055f97a700611 in trx_t::commit (this=this@entry=0x1ac73ffcea80, deleted=std::vector of length 0, capacity 0) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/dict/drop.cc:238
#4 0x000055f97a5f1ae6 in ha_innobase::commit_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>, commit=<optimized out>)
at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/handler0alter.cc:11549
…
(rr) print mtr->m_commit_lsn
$1 = 19710260
The reason why the DDL commit was not written is related to MDEV-24341. trx_flush_log_if_needed() is invoking an asynchronous write, and we fail to wait for that to complete before returning from the DDL operation:
if ((cb.m_param= thd_increment_pending_ops(trx->mysql_thd)))
Marko Mäkelä
added a comment - The reason why the DDL commit was not written is related to MDEV-24341 . trx_flush_log_if_needed() is invoking an asynchronous write, and we fail to wait for that to complete before returning from the DDL operation:
if ((cb.m_param= thd_increment_pending_ops(trx->mysql_thd)))
{
cb.m_callback = ( void (*)( void *)) thd_decrement_pending_ops;
log_write_up_to(lsn, flush, false , &cb);
}
It looks like this must have been broken for a longer time. MDEV-24341 was implemented already in MariaDB Server 10.6.0. The last fundamental InnoDB change related to atomic ALTER TABLE (MDEV-25180) was the third part of MDEV-25506 in MariaDB Server 10.6.2.
wlad confirmed to me that we would either need a call to thd->async_state.wait_for_pending_ops(); after the DDL operation returns from InnoDB, or a synchronous call of log_write_up_to() (without a completion callback) is needed, to ensure the correct durability on DDL.
Marko Mäkelä
added a comment - It looks like this must have been broken for a longer time. MDEV-24341 was implemented already in MariaDB Server 10.6.0. The last fundamental InnoDB change related to atomic ALTER TABLE ( MDEV-25180 ) was the third part of MDEV-25506 in MariaDB Server 10.6.2.
wlad confirmed to me that we would either need a call to thd->async_state.wait_for_pending_ops(); after the DDL operation returns from InnoDB, or a synchronous call of log_write_up_to() (without a completion callback) is needed, to ensure the correct durability on DDL.
After all, this does look like a regression due to this preparatory change of MDEV-30100, which would cause the LSN to be 0 for the calls log_write_up_to(commit_lsn, true) in DDL operations.
In fact, mleich did catch this type of failure while testing MDEV-30100, and that preparatory change was revised accordingly (but insufficiently). I think that we must revert that change:
We can make use of the field trx_t::flush_log_later in all DDL operations. The only DDL operation that does not invoke trx_t::commit(std::vector<pfs_os_file_t> &) is ha_innobase::rename_table().
Marko Mäkelä
added a comment - After all, this does look like a regression due to this preparatory change of MDEV-30100 , which would cause the LSN to be 0 for the calls log_write_up_to(commit_lsn, true) in DDL operations.
In fact, mleich did catch this type of failure while testing MDEV-30100 , and that preparatory change was revised accordingly (but insufficiently). I think that we must revert that change:
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc
index 751d7567881..e0eb723426f 100644
--- a/storage/innobase/trx/trx0trx.cc
+++ b/storage/innobase/trx/trx0trx.cc
@@ -1238,7 +1238,7 @@ static void trx_flush_log_if_needed(lsn_t lsn, trx_t *trx)
if (log_sys.get_flushed_lsn() > lsn)
return;
- const bool flush= trx->dict_operation ||
+ const bool flush=
(srv_file_flush_method != SRV_NOSYNC &&
(srv_flush_log_at_trx_commit & 1));
We can make use of the field trx_t::flush_log_later in all DDL operations. The only DDL operation that does not invoke trx_t::commit(std::vector<pfs_os_file_t> &) is ha_innobase::rename_table() .
People
Marko Mäkelä
Matthias Leich
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":1681.6000000238419,"ttfb":468.10000002384186,"pageVisibility":"visible","entityId":124835,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"39b16f9a-5ce4-4ffa-ad27-e6c18ff79ec6","navigationType":0,"readyForUser":1744.3999999761581,"redirectCount":0,"resourceLoadedEnd":1934.1000000238419,"resourceLoadedStart":474.2000000476837,"resourceTiming":[{"duration":306.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":474.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":474.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":780.5,"responseStart":0,"secureConnectionStart":0},{"duration":306.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":474.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":474.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":781,"responseStart":0,"secureConnectionStart":0},{"duration":318.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":474.7000000476837,"connectEnd":474.7000000476837,"connectStart":474.7000000476837,"domainLookupEnd":474.7000000476837,"domainLookupStart":474.7000000476837,"fetchStart":474.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":474.7000000476837,"responseEnd":793.6000000238419,"responseStart":793.6000000238419,"secureConnectionStart":474.7000000476837},{"duration":726.8000000715256,"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":474.7999999523163,"connectEnd":474.7999999523163,"connectStart":474.7999999523163,"domainLookupEnd":474.7999999523163,"domainLookupStart":474.7999999523163,"fetchStart":474.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":474.7999999523163,"responseEnd":1201.6000000238419,"responseStart":1201.6000000238419,"secureConnectionStart":474.7999999523163},{"duration":753.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":475,"connectEnd":475,"connectStart":475,"domainLookupEnd":475,"domainLookupStart":475,"fetchStart":475,"redirectEnd":0,"redirectStart":0,"requestStart":475,"responseEnd":1228.5,"responseStart":1228.5,"secureConnectionStart":475},{"duration":767,"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":475.10000002384186,"connectEnd":475.10000002384186,"connectStart":475.10000002384186,"domainLookupEnd":475.10000002384186,"domainLookupStart":475.10000002384186,"fetchStart":475.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":475.10000002384186,"responseEnd":1242.1000000238419,"responseStart":1242.1000000238419,"secureConnectionStart":475.10000002384186},{"duration":806.9000000953674,"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":475.2999999523163,"connectEnd":475.2999999523163,"connectStart":475.2999999523163,"domainLookupEnd":475.2999999523163,"domainLookupStart":475.2999999523163,"fetchStart":475.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":475.2999999523163,"responseEnd":1282.2000000476837,"responseStart":1282.2000000476837,"secureConnectionStart":475.2999999523163},{"duration":812.8999999761581,"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":475.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":475.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1288.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":898.3999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":475.7000000476837,"connectEnd":475.7000000476837,"connectStart":475.7000000476837,"domainLookupEnd":475.7000000476837,"domainLookupStart":475.7000000476837,"fetchStart":475.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":475.7000000476837,"responseEnd":1374.1000000238419,"responseStart":1374.1000000238419,"secureConnectionStart":475.7000000476837},{"duration":1051.5,"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":475.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":475.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1527.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":899.1999999284744,"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":476.2000000476837,"connectEnd":476.2000000476837,"connectStart":476.2000000476837,"domainLookupEnd":476.2000000476837,"domainLookupStart":476.2000000476837,"fetchStart":476.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":476.2000000476837,"responseEnd":1375.3999999761581,"responseStart":1375.3999999761581,"secureConnectionStart":476.2000000476837},{"duration":1187.8999999761581,"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":511.2000000476837,"connectEnd":511.2000000476837,"connectStart":511.2000000476837,"domainLookupEnd":511.2000000476837,"domainLookupStart":511.2000000476837,"fetchStart":511.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":511.2000000476837,"responseEnd":1699.1000000238419,"responseStart":1699.1000000238419,"secureConnectionStart":511.2000000476837},{"duration":1406,"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":511.2999999523163,"connectEnd":511.2999999523163,"connectStart":511.2999999523163,"domainLookupEnd":511.2999999523163,"domainLookupStart":511.2999999523163,"fetchStart":511.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":511.2999999523163,"responseEnd":1917.2999999523163,"responseStart":1917.2999999523163,"secureConnectionStart":511.2999999523163},{"duration":399.39999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":980,"connectEnd":980,"connectStart":980,"domainLookupEnd":980,"domainLookupStart":980,"fetchStart":980,"redirectEnd":0,"redirectStart":0,"requestStart":980,"responseEnd":1379.3999999761581,"responseStart":1379.3999999761581,"secureConnectionStart":980},{"duration":260.2000000476837,"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":1533.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1533.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1794,"responseStart":0,"secureConnectionStart":0},{"duration":397,"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":1534.7999999523163,"connectEnd":1534.7999999523163,"connectStart":1534.7999999523163,"domainLookupEnd":1534.7999999523163,"domainLookupStart":1534.7999999523163,"fetchStart":1534.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":1534.7999999523163,"responseEnd":1931.7999999523163,"responseStart":1931.7999999523163,"secureConnectionStart":1534.7999999523163},{"duration":398.89999997615814,"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":1535.2000000476837,"connectEnd":1535.2000000476837,"connectStart":1535.2000000476837,"domainLookupEnd":1535.2000000476837,"domainLookupStart":1535.2000000476837,"fetchStart":1535.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1535.2000000476837,"responseEnd":1934.1000000238419,"responseStart":1934.1000000238419,"secureConnectionStart":1535.2000000476837}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":262,"responseStart":468,"responseEnd":496,"domLoading":472,"domInteractive":1972,"domContentLoadedEventStart":1972,"domContentLoadedEventEnd":2036,"domComplete":2356,"loadEventStart":2356,"loadEventEnd":2356,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1933.7000000476837},{"name":"bigPipe.sidebar-id.end","time":1934.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1934.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1938.5},{"name":"activityTabFullyLoaded","time":2062.100000023842}],"measures":[],"correlationId":"fb1c497f3a99ca","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":129,"dbReadsTimeInMs":16,"dbConnsTimeInMs":26,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The first server instance after bootstrap executed an ALTER TABLE slightly before it was killed:
Thread 54 hit Breakpoint 2, ha_innobase::commit_inplace_alter_table (this=0xc826406c8b0, altered_table=0x7f2b2f087d90, ha_alter_info=0x7f2b2f087cd0, commit=true) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/handler0alter.cc:11093
11093 {
1: m_prebuilt.table.name = {m_name = 0x7aac48017d70 "test/t3"}
3: m_user_thd.query_string = {string = {str = 0xc8264028220 "ALTER TABLE t3 ADD FULLTEXT INDEX IF NOT EXISTS `Marvão_ftidx2` ( col_text ), ADD UNIQUE KEY IF NOT EXISTS `Marvão_uidx1` ( col2 /* 100800 ASC */, col1 /* 100800 DESC */ ) /* E_R Thread2 QNO 332 CO"..., length = 210}, cs = 0x55f97b094520 <my_charset_latin1>}
Current event: 433927
Thread 47 received signal SIGKILL, Killed.
[Switching to Thread 3460236.3474134]
0x0000000070000002 in syscall_traced ()
(rr) when
Current event: 434122
It looks like the last persistent write (update of log_sys.flushed_to_disk_lsn) was some time earlier in this thread:
#6 0x000055f97a6a09e4 in trx_t::commit_persist (this=this@entry=0x1ac73ffcea80) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/trx/trx0trx.cc:1583
#7 0x000055f97a700611 in trx_t::commit (this=this@entry=0x1ac73ffcea80, deleted=std::vector of length 0, capacity 0) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/dict/drop.cc:238
#8 0x000055f97a5e50b1 in commit_unlock_and_unlink (trx=0x1ac73ffcea80) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/handler0alter.cc:4339
#9 0x000055f97a5ec0cc in prepare_inplace_alter_table_dict (ha_alter_info=<optimized out>, altered_table=<optimized out>, old_table=<optimized out>, table_name=<optimized out>, flags=<optimized out>,
flags2=<optimized out>, fts_doc_id_col=<optimized out>, add_fts_doc_id=<optimized out>, add_fts_doc_id_idx=<optimized out>) at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/handler0alter.cc:7352
#10 0x000055f97a5ee8e2 in ha_innobase::prepare_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>)
at /data/Server/bb-10.6-MDEV-32068/storage/innobase/handler/ha_innodb.h:695
#11 0x000055f97a1d802d in mysql_inplace_alter_table (target_mdl_request=0x7f2b2f0885e0, alter_ctx=0x7f2b2f089740, trigger_param=0x7f2b2f088190, ddl_log_state=0x7f2b2f087c70, ha_alter_info=0x7f2b2f087cd0,
altered_table=0x7f2b2f087d90, table=0xc826408d4c8, table_list=0xc8264028470, thd=0xc826401dad8) at /data/Server/bb-10.6-MDEV-32068/sql/sql_table.cc:7361
The later call to ha_innobase::commit_inplace_alter_table() returned false (indicating success), while log_sys.lsn=19710260 and log_sys.flushed_to_disk_lsn=19691339 (at the value of the above write). This is definitely wrong. These values remained until the SIGKILL. Because there was no call to innodb_check_version on the subsequent server startup, I suppose that the SQL layer had replaced the .frm file and cleared the ddl_recovery.log. That subsequent recovery reported the following:
2023-09-05 7:41:47 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=42486,42486
…
2023-09-05 7:41:50 0 [Note] InnoDB: 10.6.16 started; log sequence number 19709789; transaction id 6814
…
2023-09-05 7:42:03 6 [ERROR] Cannot find index Marvão_uidx1 in InnoDB index dictionary.
2023-09-05 7:42:03 6 [ERROR] InnoDB indexes are inconsistent with what defined in .frm for table ./test/t3
2023-09-05 7:42:03 6 [ERROR] InnoDB: Table test/t3 contains 2 indexes inside InnoDB, which is different from the number of indexes 3 defined in the .frm file. See https://mariadb.com/kb/en/innodb-troubleshooting/
I believe that this is a regression due to
MDEV-30100. We must durably write the log for committing a DDL transaction.