Commit c0439b17 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.7 into 10.8

parents 5b1eb87b 22ab79c4
call mtr.add_suppression("mariadbd.*: File .*");
call mtr.add_suppression("Plugin 'file_key_management' .*");
call mtr.add_suppression("InnoDB: We do not continue the crash recovery");
call mtr.add_suppression("mariadbd.*: File ");
call mtr.add_suppression("Plugin 'file_key_management' ");
call mtr.add_suppression("InnoDB: Recovery cannot access file");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
......
......@@ -3,9 +3,9 @@
# embedded does not support restart
-- source include/not_embedded.inc
call mtr.add_suppression("mariadbd.*: File .*");
call mtr.add_suppression("Plugin 'file_key_management' .*");
call mtr.add_suppression("InnoDB: We do not continue the crash recovery");
call mtr.add_suppression("mariadbd.*: File ");
call mtr.add_suppression("Plugin 'file_key_management' ");
call mtr.add_suppression("InnoDB: Recovery cannot access file");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
......
......@@ -12,7 +12,7 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check Warning InnoDB: Index 'b' contains 990 entries, should be 1024.
test.t1 check error Corrupt
# restart
# restart: --innodb-force_recovery=0
SET GLOBAL innodb_fast_shutdown=0;
# restart
# restart: --innodb-force_recovery=0
DROP TABLE t1;
......@@ -11,6 +11,8 @@ call mtr.add_suppression("InnoDB: Failed to find tablespace for table `test`\\.`
call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for test.t1, old maximum was");
call mtr.add_suppression("InnoDB: Failed to find tablespace for table `mysql`\\.`transaction_registry` in the cache\\. Attempting to load the tablespace with space id");
call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for mysql.transaction_registry, old maximum was");
call mtr.add_suppression("InnoDB: Trying to read 4096 bytes");
call mtr.add_suppression("InnoDB: File './test/t1.ibd' is corrupted");
--enable_query_log
CREATE TABLE t1(
......@@ -106,7 +108,7 @@ truncate(FILE, $ps * $pages);
close(FILE) || die "Unable to close $file";
EOF
--let $restart_parameters=
--let $restart_parameters=--innodb-force_recovery=0
--source include/start_mysqld.inc
SET GLOBAL innodb_fast_shutdown=0;
--source include/restart_mysqld.inc
......
......@@ -1110,7 +1110,6 @@ void setup_connection_thread_globals(THD *thd)
{
DBUG_EXECUTE_IF("CONNECT_wait", {
extern Dynamic_array<MYSQL_SOCKET> listen_sockets;
DBUG_ASSERT(listen_sockets.size());
while (listen_sockets.size())
my_sleep(1000);
});
......
......@@ -2687,7 +2687,7 @@ buf_page_get_low(
re_evict:
if (mode != BUF_GET_IF_IN_POOL
&& mode != BUF_GET_IF_IN_POOL_OR_WATCH) {
} else if (!ibuf_debug) {
} else if (!ibuf_debug || recv_recovery_is_on()) {
} else if (fil_space_t* space = fil_space_t::get(page_id.space())) {
/* Try to evict the block from the buffer pool, to use the
insert buffer (change buffer) as much as possible. */
......
This diff is collapsed.
......@@ -967,8 +967,9 @@ ATTRIBUTE_COLD void logs_empty_and_mark_files_at_shutdown()
if (srv_fast_shutdown == 2 || !srv_was_started) {
if (!srv_read_only_mode && srv_was_started) {
ib::info() << "Executing innodb_fast_shutdown=2."
" Next startup will execute crash recovery!";
sql_print_information(
"InnoDB: Executing innodb_fast_shutdown=2."
" Next startup will execute crash recovery!");
/* In this fastest shutdown we do not flush the
buffer pool:
......
......@@ -986,6 +986,20 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
DB_SUCCESS == os_file_punch_hole(node->handle, 0, 4096) &&
!my_test_if_thinly_provisioned(node->handle);
#endif
/* Mimic fil_node_t::read_page0() in case the file exists and
has already been extended to a larger size. */
ut_ad(node->size == size);
const os_offset_t file_size= os_file_get_size(node->handle);
if (file_size != os_offset_t(-1))
{
const uint32_t n_pages=
uint32_t(file_size / fil_space_t::physical_size(flags));
if (n_pages > size)
{
space->size= node->size= n_pages;
space->set_committed_size();
}
}
if (!os_file_set_size(node->name, node->handle,
(size * fil_space_t::physical_size(flags)) &
~4095ULL, is_sparse))
......@@ -1325,40 +1339,22 @@ static void fil_name_process(const char *name, ulint len, uint32_t space_id,
case FIL_LOAD_INVALID:
ut_ad(space == NULL);
if (srv_force_recovery == 0) {
sql_print_warning(
"InnoDB: We do not continue the crash"
" recovery, because the table may"
" become corrupt if we cannot apply"
" the log records in the InnoDB log to"
" it. To fix the problem and start"
" mariadbd:");
sql_print_information(
"InnoDB: 1) If there is a permission"
" problem in the file and mysqld"
" cannot open the file, you should"
" modify the permissions.");
sql_print_information(
"InnoDB: 2) If the tablespace is not"
" needed, or you can restore an older"
" version from a backup, then you can"
" remove the .ibd file, and use"
" --innodb_force_recovery=1 to force"
" startup without this file.");
sql_print_information(
"InnoDB: 3) If the file system or the"
" disk is broken, and you cannot"
" remove the .ibd file, you can set"
" --innodb_force_recovery.");
sql_print_error("InnoDB: Recovery cannot access"
" file %s (tablespace "
UINT32PF ")", name, space_id);
sql_print_information("InnoDB: You may set "
"innodb_force_recovery=1"
" to ignore this and"
" possibly get a"
" corrupted database.");
recv_sys.set_corrupt_fs();
break;
}
sql_print_information(
"InnoDB: innodb_force_recovery was set to %lu."
" Continuing crash recovery even though"
" we cannot access the files for tablespace "
UINT32PF ".", srv_force_recovery, space_id);
break;
sql_print_warning("InnoDB: Ignoring changes to"
" file %s (tablespace " UINT32PF ")"
" due to innodb_force_recovery",
name, space_id);
}
}
}
......
......@@ -704,7 +704,7 @@ row_mysql_handle_errors(
" table. You have to dump + drop + reimport the"
" table or, in a case of widespread corruption,"
" dump all InnoDB tables and recreate the whole"
" tablespace. If the mysqld server crashes after"
" tablespace. If the mariadbd server crashes after"
" the startup or when you dump the tables. "
<< FORCE_RECOVERY_MSG;
goto rollback_to_savept;
......
......@@ -1525,6 +1525,10 @@ void srv_shutdown(bool ibuf_merge)
if (ibuf_merge) {
srv_main_thread_op_info = "doing insert buffer merge";
/* Disallow the use of change buffer to
avoid a race condition with
ibuf_read_merge_pages() */
ibuf_max_size_update(0);
log_free_check();
n_read = ibuf_contract();
srv_shutdown_print(now, n_read);
......
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation.
Copyright (c) 2017, 2022, 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
......
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