Skip to content

Commit cff9939

Browse files
committed
MDEV-30068 Confusing error message when encryption is not available on recovery
fil_name_process(): If fil_ibd_load() returns FIL_LOAD_INVALID, display the file name and the tablespace identifier.
1 parent 4e5e816 commit cff9939

File tree

3 files changed

+18
-31
lines changed

3 files changed

+18
-31
lines changed

mysql-test/suite/encryption/r/innodb-redo-nokeys.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
call mtr.add_suppression("mariadbd.*: File .*");
2-
call mtr.add_suppression("Plugin 'file_key_management' .*");
3-
call mtr.add_suppression("InnoDB: We do not continue the crash recovery");
1+
call mtr.add_suppression("mariadbd.*: File ");
2+
call mtr.add_suppression("Plugin 'file_key_management' ");
3+
call mtr.add_suppression("InnoDB: Recovery cannot access file");
44
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
55
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
66
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");

mysql-test/suite/encryption/t/innodb-redo-nokeys.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# embedded does not support restart
44
-- source include/not_embedded.inc
55

6-
call mtr.add_suppression("mariadbd.*: File .*");
7-
call mtr.add_suppression("Plugin 'file_key_management' .*");
8-
call mtr.add_suppression("InnoDB: We do not continue the crash recovery");
6+
call mtr.add_suppression("mariadbd.*: File ");
7+
call mtr.add_suppression("Plugin 'file_key_management' ");
8+
call mtr.add_suppression("InnoDB: Recovery cannot access file");
99
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
1010
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
1111
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");

storage/innobase/log/log0recv.cc

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -879,35 +879,22 @@ fil_name_process(char* name, ulint len, ulint space_id, bool deleted)
879879
case FIL_LOAD_INVALID:
880880
ut_ad(space == NULL);
881881
if (srv_force_recovery == 0) {
882-
ib::warn() << "We do not continue the crash"
883-
" recovery, because the table may"
884-
" become corrupt if we cannot apply"
885-
" the log records in the InnoDB log to"
886-
" it. To fix the problem and start"
887-
" mysqld:";
888-
ib::info() << "1) If there is a permission"
889-
" problem in the file and mysqld"
890-
" cannot open the file, you should"
891-
" modify the permissions.";
892-
ib::info() << "2) If the tablespace is not"
893-
" needed, or you can restore an older"
894-
" version from a backup, then you can"
895-
" remove the .ibd file, and use"
896-
" --innodb_force_recovery=1 to force"
897-
" startup without this file.";
898-
ib::info() << "3) If the file system or the"
899-
" disk is broken, and you cannot"
900-
" remove the .ibd file, you can set"
901-
" --innodb_force_recovery.";
882+
sql_print_error("InnoDB: Recovery cannot access"
883+
" file %s (tablespace "
884+
ULINTPF ")", name, space_id);
885+
sql_print_information("InnoDB: You may set "
886+
"innodb_force_recovery=1"
887+
" to ignore this and"
888+
" possibly get a"
889+
" corrupted database.");
902890
recv_sys.found_corrupt_fs = true;
903891
break;
904892
}
905893

906-
ib::info() << "innodb_force_recovery was set to "
907-
<< srv_force_recovery << ". Continuing crash"
908-
" recovery even though we cannot access the"
909-
" files for tablespace " << space_id << ".";
910-
break;
894+
sql_print_warning("InnoDB: Ignoring changes to"
895+
" file %s (tablespace " ULINTPF ")"
896+
" due to innodb_force_recovery",
897+
name, space_id);
911898
}
912899
}
913900
}

0 commit comments

Comments
 (0)