Commit 481aa0af authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent a441a569
/*****************************************************************************
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment