summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-10-25 15:14:43 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-10-25 15:14:43 +0300
commit481aa0af46930f2252cb8160358b5bd0fd4a8be6 (patch)
treed860309b10e6cb8992b030bcecf5150446c32d58
parenta441a569157bf75303e3f9f485211c4b5d4f6129 (diff)
downloadmariadb-git-481aa0af46930f2252cb8160358b5bd0fd4a8be6.tar.gz
MDEV-23267 Assertion on --bootstrap --innodb-force-recovery
SysTablespace::file_not_found(): If the system tablespace cannot be found and innodb_force_recovery has been specified, refuse to start up. The system tablespace is necessary for accessing any InnoDB tables, because it contains the TRX_SYS page (the state of transactions) and the InnoDB data dictionary. This is similar to our handling of innodb_read_only except that we will happily create the InnoDB temporary tablespace even if innodb_force_recovry is set.
-rw-r--r--storage/innobase/fsp/fsp0sysspace.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc
index dc5a27e2f2c..1e2db8cc12f 100644
--- a/storage/innobase/fsp/fsp0sysspace.cc
+++ b/storage/innobase/fsp/fsp0sysspace.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 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
@@ -684,13 +685,18 @@ SysTablespace::file_not_found(
{
file.m_exists = false;
- if (srv_read_only_mode && !m_ignore_read_only) {
+ if (m_ignore_read_only) {
+ } else if (srv_read_only_mode) {
ib::error() << "Can't create file '" << file.filepath()
<< "' when --innodb-read-only is set";
-
return(DB_ERROR);
+ } else if (srv_force_recovery && space_id() == TRX_SYS_SPACE) {
+ ib::error() << "Can't create file '" << file.filepath()
+ << "' when --innodb-force-recovery is set";
+ return DB_ERROR;
+ }
- } else if (&file == &m_files.front()) {
+ if (&file == &m_files.front()) {
/* First data file. */
ut_a(!*create_new_db);