Skip to content

Commit

Permalink
MDEV-23267 Assertion on --bootstrap --innodb-force-recovery
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed Oct 25, 2021
1 parent a441a56 commit 481aa0a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions 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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 481aa0a

Please sign in to comment.