Details
-
Bug
-
Status: In Review (View Workflow)
-
Critical
-
Resolution: Unresolved
-
13.0, 13.1
-
Can result in data loss
Description
The following test would crash InnoDB in log_t::header_rewrite(), either in a fatal signal the memory-mapped path (when attempting to modify the read-only mapping log_sys.buf, or in the pwrite code path:
--source include/have_innodb.inc
|
--let $restart_parameters=--innodb-read-only
|
--source include/restart_mysqld.inc
|
SET GLOBAL innodb_log_archive=!@@GLOBAL.innodb_log_archive; |
2026-09-03 15:28:52 3 [Note] InnoDB: setting innodb_log_archive=1 at innodb_log_recovery_start=54088
|
2026-09-03 15:28:52 3 [ERROR] [FATAL] InnoDB: pwrite(log) returned -1, operating system error 9
|
The expected outcome should be:
mysqltest: At line 4: query 'SET GLOBAL innodb_log_archive=!@@GLOBAL.innodb_log_archive' failed: ER_INNODB_READ_ONLY (1874): InnoDB is in read only mode
|
This is achieved by the following patch:
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc
|
index f1834bd8f67..297574a49b6 100644
|
--- a/storage/innobase/log/log0log.cc
|
+++ b/storage/innobase/log/log0log.cc
|
@@ -767,6 +767,12 @@ void log_t::header_rewrite(my_bool archive) noexcept
|
@param thd SQL connection */
|
void log_t::set_archive(my_bool archive, THD *thd) noexcept
|
{
|
+ if (UNIV_UNLIKELY(recv_sys.rpo != 0))
|
+ {
|
+ my_error(ER_INNODB_READ_ONLY, MYF(0));
|
+ return true;
|
+ }
|
+
|
thd_wait_begin(thd, THD_WAIT_DISKIO);
|
tpool::tpool_wait_begin();
|
lsn_t wait_lsn; |
Attachments
Issue Links
- is caused by
-
MDEV-37949 Implement innodb_log_archive
-
- Closed
-