diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index f92beac0f67..0af5982806f 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -3812,7 +3812,7 @@ dict_stats_update( if (!table->is_readable()) { return (dict_stats_report_error(table)); - } else if (srv_force_recovery > SRV_FORCE_NO_IBUF_MERGE) { + } else if (srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN) { /* If we have set a high innodb_force_recovery level, do not calculate statistics, as a badly corrupted index can cause a crash in it. */ diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b508d0246e7..64ecc7ae957 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -5845,7 +5845,7 @@ initialize_auto_increment(dict_table_t* table, const Field* field) table->persistent_autoinc without autoinc_mutex protection, and there might be multiple ha_innobase::open() executing concurrently. */ - } else if (srv_force_recovery > SRV_FORCE_NO_IBUF_MERGE) { + } else if (srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN) { /* If the recovery level is set so high that writes are disabled we force the AUTOINC counter to 0 value effectively disabling writes to the table. @@ -14872,7 +14872,7 @@ ha_innobase::info_low( } } - if (srv_force_recovery > SRV_FORCE_NO_IBUF_MERGE) { + if (srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN) { goto func_exit; diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 0c32d5d686a..be25bc86519 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -562,11 +562,9 @@ enum { SRV_FORCE_NO_BACKGROUND = 2, /*!< prevent the main thread from running: if a crash would occur in purge, this prevents it */ - SRV_FORCE_NO_TRX_UNDO = 3, /*!< do not run trx rollback after + SRV_FORCE_NO_TRX_UNDO = 3, /*!< do not run DML rollback after recovery */ - SRV_FORCE_NO_IBUF_MERGE = 4, /*!< prevent also ibuf operations: - if they would cause a crash, better - not do them */ + SRV_FORCE_NO_DDL_UNDO = 4, /*!< prevent also DDL rollback */ SRV_FORCE_NO_UNDO_LOG_SCAN = 5, /*!< do not look at undo logs when starting the database: InnoDB will treat even incomplete transactions diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 3f0ccf44b1e..1fc5905ce26 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -1065,7 +1065,7 @@ dberr_t srv_start(bool create_new_db) } high_level_read_only = srv_read_only_mode - || srv_force_recovery > SRV_FORCE_NO_IBUF_MERGE + || srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN || srv_sys_space.created_new_raw(); srv_started_redo = false; @@ -1704,7 +1704,7 @@ file_checked: if (!create_new_db) { ut_ad(high_level_read_only - || srv_force_recovery <= SRV_FORCE_NO_IBUF_MERGE); + || srv_force_recovery < SRV_FORCE_NO_UNDO_LOG_SCAN); /* Validate a few system page types that were left uninitialized before MySQL or MariaDB 5.5. */ @@ -1745,7 +1745,7 @@ file_checked: should guarantee that there is at most one data dictionary transaction active at a time. */ if (!high_level_read_only - && srv_force_recovery < SRV_FORCE_NO_TRX_UNDO) { + && srv_force_recovery <= SRV_FORCE_NO_TRX_UNDO) { /* If the following call is ever removed, the first-time ha_innobase::open() must hold (or acquire and release) a table lock that @@ -1759,7 +1759,7 @@ file_checked: trx_rollback_recovered(false); } - if (srv_force_recovery <= SRV_FORCE_NO_IBUF_MERGE) { + if (srv_force_recovery < SRV_FORCE_NO_UNDO_LOG_SCAN) { /* The following call is necessary for the insert buffer to work with multiple tablespaces. We must know the mapping between space id's and .ibd file diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index a0582413d07..34e623b6b1a 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -709,7 +709,8 @@ void trx_rollback_recovered(bool all) { std::vector trx_list; - ut_a(srv_force_recovery < SRV_FORCE_NO_TRX_UNDO); + ut_a(srv_force_recovery < + (all ? SRV_FORCE_NO_TRX_UNDO : SRV_FORCE_NO_DDL_UNDO)); /* Collect list of recovered ACTIVE transaction ids first. Once collected, no