mirror of
https://github.com/MariaDB/server.git
synced 2025-11-27 05:41:41 +03:00
Before any committed DDL operation returns control to the caller, we must ensure that it will have been durably committed before the ddl_log state may be changed, no matter if innodb_flush_log_at_trx_commit=0 is being used. Operations that would involve deleting files were already safe, because the durable write of the FILE_DELETE record that would precede the file deletion would also have made the commit durable. Furthermore, when we clean up ADD INDEX stubs that were left behind by a previous ha_innobase::commit_inplace_alter_table(commit=false) when MDL could not be acquired, we will use the same interface as for dropping indexes. This safety measure should be dead code, because ADD FULLTEXT INDEX is not supported online, and dropping indexes only involves file deletion for FULLTEXT INDEX.
To debug a the ddl_recovery code in a failing ddl_recovery test one could do the following: - Add # before --exec echo "restart" ... - Force $e (engine), $c (crash point) and $r (crash position) to the values where things goes wrong. See comments in alter_table.test for how to do this. - start mariadbd in a debugger run the following in the debugger (Replace 'atomic.create_trigger' with the failing test case) #break ha_recover #break MYSQL_BIN_LOG::recover #break MYSQL_BIN_LOG::open break ddl_log_close_binlogged_events break ddl_log_execute_action break ddl_log_execute_recovery run --datadir=/my/maria-10.6/mysql-test/var/log/atomic.create_trigger/mysqld.1/data --log-basename=master --log-bin-index=mysqld-bin.index --debug --log-bin