[MDEV-12975] InnoDB redo log minimum size check uses detected file size instead of requested innodb_log_file_size Created: 2017-06-02  Updated: 2017-06-19  Resolved: 2017-06-19

Status: Closed
Project: MariaDB Server
Component/s: Backup, Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.0, 10.1.24, 10.2, 10.3
Fix Version/s: 10.1.25, 10.0.32, 10.2.7, 10.3.1

Type: Bug Priority: Major
Reporter: Andrii Nikitin (Inactive) Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
is blocked by MDEV-12709 mariabackup mtr tests don't handle pr... Closed
Relates
relates to MDEV-12966 mariabackup fails with non-default in... Closed

 Description   

$ ./mtr --mysqld=--innodb-page-size=32k --mysqld=--innodb-buffer-pool-size=24m full_backup
...
mysqltest: At line 15: exec of '10.1/build/extra/mariabackup/mariabackup  --prepare --target-dir=10.1/build/mysql-test/var/tmp/backup 2>&1' failed, error: 34304, status: 134, errno: 0
...
InnoDB: The combined size of ib_logfiles should be bigger than
InnoDB: 200 kB * innodb_thread_concurrency.
2017-06-02 07:52:04 7f80148fabc0  InnoDB: Assertion failure in thread 140188077501376 in file ha_innodb.cc line 21953



 Comments   
Comment by Andrii Nikitin (Inactive) [ 2017-06-02 ]

not sure if it MDEV-12975 is part of MDEV-12966 or separate problem

Comment by Marko Mäkelä [ 2017-06-19 ]

The problem appears to be that the srv_log_file_size is measured from the xtrabackup_logfile, not from the actual requested configuration. Later during the startup, the redo log file would be resized, but the capacity check is wrongly based on the initially measured file size.

Comment by Marko Mäkelä [ 2017-06-19 ]

I can repeat this in 10.0:

diff --git a/mysql-test/suite/innodb/t/log_file_size.test b/mysql-test/suite/innodb/t/log_file_size.test
index 4bae93957e8..741a704f1fe 100644
--- a/mysql-test/suite/innodb/t/log_file_size.test
+++ b/mysql-test/suite/innodb/t/log_file_size.test
@@ -37,6 +37,12 @@ call mtr.add_suppression("Attempting backtrace");
 FLUSH TABLES;
 --enable_query_log
 
+--let $restart_parameters= --innodb-thread-concurrency=1 --innodb-log-file-size=1m --innodb-log-files-in-group=2
+--source include/restart_mysqld.inc
+
+--let $restart_parameters= --innodb-thread-concurrency=300 --innodb-log-file-size=10M --innodb-log-files-in-group=2
+--source include/restart_mysqld.inc
+
 CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
 BEGIN;
 INSERT INTO t1 VALUES (42);

CURRENT_TEST: innodb.log_file_size
 
 
Server [mysqld.1 - pid: 18181, winpid: 18181, exit: 256] failed during test run
Server log from this test:
InnoDB: Error: ib_logfiles are too small for innodb_thread_concurrency 300.
InnoDB: The combined size of ib_logfiles should be bigger than
InnoDB: 200 kB * innodb_thread_concurrency.

This bug should be present in MySQL as well. I did not think of this case when implementing InnoDB redo log resizing in MySQL 5.6.8.

Comment by Marko Mäkelä [ 2017-06-19 ]

Note: the formula stated in the error message is inaccurate. Also note that the calculation depends on innodb_page_size, so with innodb_page_size=64k the minimum innodb_log_file_size is roughly 4 times the minimum size required for innodb_page_size=16k for the same innodb_thread_concurrency.

Generated at Thu Feb 08 08:01:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.