Commit 13af3982 authored by Michael Widenius's avatar Michael Widenius

Fixed recovery crash lp:814806 "Unclean shutdown corrupted Aria table blocking startup"

storage/maria/ma_recovery.c:
  Moved trman_init() before parse_checkpoint_record() as this calls trnman functions if we have to open tables.
parent b5f830d8
...@@ -320,25 +320,32 @@ int maria_apply_log(LSN from_lsn, LSN end_lsn, ...@@ -320,25 +320,32 @@ int maria_apply_log(LSN from_lsn, LSN end_lsn,
skip_DDLs= skip_DDLs_arg; skip_DDLs= skip_DDLs_arg;
skipped_undo_phase= 0; skipped_undo_phase= 0;
trnman_init(max_trid_in_control_file);
if (from_lsn == LSN_IMPOSSIBLE) if (from_lsn == LSN_IMPOSSIBLE)
{ {
if (last_checkpoint_lsn == LSN_IMPOSSIBLE) if (last_checkpoint_lsn == LSN_IMPOSSIBLE)
{ {
from_lsn= translog_first_lsn_in_log(); from_lsn= translog_first_lsn_in_log();
if (unlikely(from_lsn == LSN_ERROR)) if (unlikely(from_lsn == LSN_ERROR))
{
trnman_destroy();
goto err; goto err;
} }
}
else else
{ {
from_lsn= parse_checkpoint_record(last_checkpoint_lsn); from_lsn= parse_checkpoint_record(last_checkpoint_lsn);
if (from_lsn == LSN_ERROR) if (from_lsn == LSN_ERROR)
{
trnman_destroy();
goto err; goto err;
} }
} }
}
now= my_getsystime(); now= my_getsystime();
in_redo_phase= TRUE; in_redo_phase= TRUE;
trnman_init(max_trid_in_control_file);
if (run_redo_phase(from_lsn, end_lsn, apply)) if (run_redo_phase(from_lsn, end_lsn, apply))
{ {
ma_message_no_user(0, "Redo phase failed"); ma_message_no_user(0, "Redo phase failed");
......
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