diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-05-20 09:43:25 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-05-21 18:03:40 +0300 |
commit | 7bdb8d125e9e4524bee98667734f113617347b63 (patch) | |
tree | 3511fed9106b293b28e4ee928ce80483c16f3273 | |
parent | 9eb4ad57de06fa55caaf8da2de3c0ad28a139cda (diff) | |
download | mariadb-git-7bdb8d125e9e4524bee98667734f113617347b63.tar.gz |
Cleanup: Remove the error code DB_MUST_GET_MORE_FILE_SPACE
Ever since MDEV-24589, MDEV-18518 and other recent changes corrected the
rollback of CREATE and DROP operations, there is no need to crash the
server if we run out of space during a DROP operation. We can simply
let the transaction be rolled back.
-rw-r--r-- | mysql-test/suite/innodb/r/innodb-wl5522-debug.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result | 4 | ||||
-rw-r--r-- | storage/innobase/dict/dict0crea.cc | 16 | ||||
-rw-r--r-- | storage/innobase/include/db0err.h | 4 | ||||
-rw-r--r-- | storage/innobase/row/row0mysql.cc | 21 | ||||
-rw-r--r-- | storage/innobase/ut/ut0ut.cc | 2 |
6 files changed, 9 insertions, 42 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result index 4d312e59115..94d181ce448 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result @@ -453,7 +453,7 @@ restore: t1 .ibd and .cfg files SET SESSION debug_dbug=@saved_debug_dbug; SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Got error 43 'Tablespace not found' from ./test/t1.ibd +ERROR HY000: Got error 42 'Tablespace not found' from ./test/t1.ibd SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; @@ -922,7 +922,7 @@ ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Got error 38 'Data structure corruption' from ./test/t1.ibd +ERROR HY000: Got error 37 'Data structure corruption' from ./test/t1.ibd SET SESSION debug_dbug=@saved_debug_dbug; DROP TABLE t1; unlink: t1.ibd diff --git a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result index 92ca5a10bb1..92886ef7505 100644 --- a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result +++ b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result @@ -88,7 +88,7 @@ restore: t1 .ibd and .cfg files SET SESSION debug_dbug=@saved_debug_dbug; SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Got error 43 'Tablespace not found' from ./test/t1.ibd +ERROR HY000: Got error 42 'Tablespace not found' from ./test/t1.ibd SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; @@ -388,7 +388,7 @@ ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Got error 38 'Data structure corruption' from ./test/t1.ibd +ERROR HY000: Got error 37 'Data structure corruption' from ./test/t1.ibd SET SESSION debug_dbug=@saved_debug_dbug; DROP TABLE t1; unlink: t1.ibd diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index cf5c6d5014f..1d2f4f1abb1 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -1462,14 +1462,10 @@ dict_create_or_check_foreign_constraint_tables(void) ut_ad(err == DB_OUT_OF_FILE_SPACE || err == DB_TOO_MANY_CONCURRENT_TRXS); trx->rollback(); - - if (err == DB_OUT_OF_FILE_SPACE) { - err = DB_MUST_GET_MORE_FILE_SPACE; - } + } else { + trx_commit_for_mysql(trx); } - trx_commit_for_mysql(trx); - row_mysql_unlock_data_dictionary(trx); trx->free(); @@ -1552,14 +1548,10 @@ dict_create_or_check_sys_virtual() ut_ad(err == DB_OUT_OF_FILE_SPACE || err == DB_TOO_MANY_CONCURRENT_TRXS); trx->rollback(); - - if (err == DB_OUT_OF_FILE_SPACE) { - err = DB_MUST_GET_MORE_FILE_SPACE; - } + } else { + trx_commit_for_mysql(trx); } - trx_commit_for_mysql(trx); - row_mysql_unlock_data_dictionary(trx); trx->free(); diff --git a/storage/innobase/include/db0err.h b/storage/innobase/include/db0err.h index caf85113e51..98d02e3a767 100644 --- a/storage/innobase/include/db0err.h +++ b/storage/innobase/include/db0err.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2018, MariaDB Corporation. +Copyright (c) 2015, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -49,8 +49,6 @@ enum dberr_t { rollback segment */ DB_CLUSTER_NOT_FOUND = 30, DB_TABLE_NOT_FOUND, - DB_MUST_GET_MORE_FILE_SPACE, /*!< the database has to be stopped - and restarted with more file space */ DB_TOO_BIG_RECORD, /*!< a record in an index would not fit on a compressed page, or it would become bigger than 1/2 free space in diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index ebd8c89a5e9..8b12714d3d4 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -760,12 +760,6 @@ handle_new_error: trx->rollback(); break; - case DB_MUST_GET_MORE_FILE_SPACE: - ib::fatal() << "The database cannot continue operation because" - " of lack of space. You must add a new data file" - " to my.cnf and restart the database."; - break; - case DB_CORRUPTION: case DB_PAGE_CORRUPTED: ib::error() << "We detected index corruption in an InnoDB type" @@ -3617,21 +3611,6 @@ do_drop: } break; - case DB_OUT_OF_FILE_SPACE: - err = DB_MUST_GET_MORE_FILE_SPACE; - trx->error_state = err; - row_mysql_handle_errors(&err, trx, NULL, NULL); - - /* raise error */ - ut_error; - break; - - case DB_TOO_MANY_CONCURRENT_TRXS: - /* Cannot even find a free slot for the - the undo log. We can directly exit here - and return the DB_TOO_MANY_CONCURRENT_TRXS - error. */ - default: /* This is some error we do not expect. Print the error number and rollback the transaction */ diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc index aad3e0d2815..41ba54d9a8d 100644 --- a/storage/innobase/ut/ut0ut.cc +++ b/storage/innobase/ut/ut0ut.cc @@ -364,8 +364,6 @@ ut_strerr( return("Cluster not found"); case DB_TABLE_NOT_FOUND: return("Table not found"); - case DB_MUST_GET_MORE_FILE_SPACE: - return("More file space needed"); case DB_TOO_BIG_RECORD: return("Record too big"); case DB_TOO_BIG_INDEX_COL: |