mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-35810 Missing error handling in log resizing
log_t::resize_start(): If the ib_logfile101 cannot be created, be sure to reset log_sys.resize_lsn. log_t::resize_abort(): In case SET GLOBAL innodb_log_file_size is aborted, delete the ib_logfile101.
This commit is contained in:
@@ -31,6 +31,7 @@ BEGIN
|
|||||||
WHERE variable_name NOT IN ('timestamp')
|
WHERE variable_name NOT IN ('timestamp')
|
||||||
AND variable_name not like "Last_IO_Err*"
|
AND variable_name not like "Last_IO_Err*"
|
||||||
AND variable_name != 'INNODB_IBUF_MAX_SIZE'
|
AND variable_name != 'INNODB_IBUF_MAX_SIZE'
|
||||||
|
AND variable_name != 'INNODB_LOG_FILE_BUFFERING'
|
||||||
AND variable_name != 'INNODB_USE_NATIVE_AIO'
|
AND variable_name != 'INNODB_USE_NATIVE_AIO'
|
||||||
AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP'
|
AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP'
|
||||||
AND variable_name not like 'GTID%POS'
|
AND variable_name not like 'GTID%POS'
|
||||||
|
@@ -25,8 +25,14 @@ SET GLOBAL innodb_log_file_buffering=ON;
|
|||||||
SET GLOBAL innodb_log_file_buffering=@save;
|
SET GLOBAL innodb_log_file_buffering=@save;
|
||||||
SET GLOBAL innodb_log_file_mmap=OFF;
|
SET GLOBAL innodb_log_file_mmap=OFF;
|
||||||
Got one of the listed errors
|
Got one of the listed errors
|
||||||
SET GLOBAL innodb_log_file_size=5242880;
|
|
||||||
connect con1,localhost,root;
|
connect con1,localhost,root;
|
||||||
|
SET GLOBAL innodb_log_file_size=7340032;
|
||||||
|
connection default;
|
||||||
|
KILL QUERY @id;
|
||||||
|
connection con1;
|
||||||
|
connection default;
|
||||||
|
SET GLOBAL innodb_log_file_size=5242880;
|
||||||
|
connection con1;
|
||||||
UPDATE t SET b='' WHERE a<10;
|
UPDATE t SET b='' WHERE a<10;
|
||||||
connection default;
|
connection default;
|
||||||
SHOW VARIABLES LIKE 'innodb_log_file_size';
|
SHOW VARIABLES LIKE 'innodb_log_file_size';
|
||||||
|
@@ -36,9 +36,19 @@ SET GLOBAL innodb_log_file_buffering=@save;
|
|||||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR,ER_UNKNOWN_SYSTEM_VARIABLE
|
--error ER_INCORRECT_GLOBAL_LOCAL_VAR,ER_UNKNOWN_SYSTEM_VARIABLE
|
||||||
SET GLOBAL innodb_log_file_mmap=OFF;
|
SET GLOBAL innodb_log_file_mmap=OFF;
|
||||||
|
|
||||||
|
--connect con1,localhost,root
|
||||||
|
let $ID= `SELECT @id := CONNECTION_ID()`;
|
||||||
|
send SET GLOBAL innodb_log_file_size=7340032;
|
||||||
|
--connection default
|
||||||
|
let $ignore= `SELECT @id := $ID`;
|
||||||
|
KILL QUERY @id;
|
||||||
|
--connection con1
|
||||||
|
reap;
|
||||||
|
|
||||||
|
--connection default
|
||||||
send SET GLOBAL innodb_log_file_size=5242880;
|
send SET GLOBAL innodb_log_file_size=5242880;
|
||||||
|
|
||||||
--connect con1,localhost,root
|
--connection con1
|
||||||
send UPDATE t SET b='' WHERE a<10;
|
send UPDATE t SET b='' WHERE a<10;
|
||||||
|
|
||||||
--connection default
|
--connection default
|
||||||
|
@@ -663,9 +663,9 @@ log_t::resize_start_status log_t::resize_start(os_offset_t size) noexcept
|
|||||||
|
|
||||||
writer_update();
|
writer_update();
|
||||||
}
|
}
|
||||||
resize_lsn.store(start_lsn, std::memory_order_relaxed);
|
|
||||||
status= success ? RESIZE_STARTED : RESIZE_FAILED;
|
status= success ? RESIZE_STARTED : RESIZE_FAILED;
|
||||||
}
|
}
|
||||||
|
resize_lsn.store(start_lsn, std::memory_order_relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
log_resize_release();
|
log_resize_release();
|
||||||
@@ -715,6 +715,8 @@ void log_t::resize_abort() noexcept
|
|||||||
resize_buf= nullptr;
|
resize_buf= nullptr;
|
||||||
resize_target= 0;
|
resize_target= 0;
|
||||||
resize_lsn.store(0, std::memory_order_relaxed);
|
resize_lsn.store(0, std::memory_order_relaxed);
|
||||||
|
std::string path{get_log_file_path("ib_logfile101")};
|
||||||
|
IF_WIN(DeleteFile(path.c_str()), unlink(path.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
writer_update();
|
writer_update();
|
||||||
|
Reference in New Issue
Block a user