Commit 7b891008 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-27817 InnoDB recovery of recently created files is not crash-safe

Before commit 86dc7b4d (MDEV-24626)
all tablespace ID that needed recovery were known already in
recv_init_crash_recovery_spaces().

recv_sys_t::recover_deferred(): Invoke fil_names_dirty(space) on
the newly initialized tablespace. In this way, if the next log
checkpoint occurs at some LSN that is after the initialization of
the tablespace and before the last recovered LSN, a FILE_MODIFY
record will be written, so that a subsequent recovery will succeed.

The recovery was broken when
commit 0261eac5 merged the 10.5
commit f443cd11 (MDEV-27022).
parent f1e08eaa
......@@ -905,6 +905,7 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
node->deferred= true;
if (!space->acquire())
goto fail;
fil_names_dirty(space);
const bool is_compressed= fil_space_t::is_compressed(flags);
#ifdef _WIN32
const bool is_sparse= is_compressed;
......@@ -4224,7 +4225,6 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
err = recv_rename_files();
}
mysql_mutex_unlock(&recv_sys.mutex);
mysql_mutex_unlock(&log_sys.mutex);
recv_lsn_checks_on = true;
......@@ -4236,6 +4236,7 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
err = DB_CORRUPTION;
}
mysql_mutex_unlock(&log_sys.mutex);
return err;
}
......
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