Got "/ib_logfile0 is of different size" when doing stream backup

Hello,

We got an error “InnoDB: Error: log file ./ib_logfile0 is of different size 5242880 bytes” when doing stream backup on Ubuntu 12.04

MySQL Server: 5.5.37-0ubuntu0.12.04.1
Xtrabackup: 2.2.3-4982-1.precise

Command: /usr/bin/innobackupex --ibbackup xtrabackup --password XXXX --user ‘scalr’ --stream xbstream /mnt/dbstorage/tmp

Log:


InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p

140623 12:50:05 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'scalr' (using password: YES).
140623 12:50:05 innobackupex: Connected to MySQL server
140623 12:50:05 innobackupex: Executing a version check against the server...
140623 12:50:06 innobackupex: Done.
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!".

innobackupex: Using mysql server version 5.5.37-0ubuntu0.12.04.1-log

innobackupex: Created backup directory /mnt/dbstorage/tmp

140623 12:50:06 innobackupex: Starting ibbackup with command: xtrabackup --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/tmp --tmpdir=/tmp --extra-lsndir='/tmp' --stream=xbstream
innobackupex: Waiting for ibbackup (pid=7964) to suspend
innobackupex: Suspend file '/tmp/xtrabackup_suspended_2'

xtrabackup version 2.2.3 based on MySQL server 5.6.17 Linux (x86_64) (revision id: )
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /mnt/dbstorage/mysql-data
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
InnoDB: Error: log file ./ib_logfile0 is of different size 5242880 bytes
InnoDB: than specified in the .cnf file 50331648 bytes!
innobackupex: Error: The xtrabackup child process has died at /usr/bin/innobackupex line 2672.


$ my_print_defaults mysqld
--user=mysql
--pid-file=/var/run/mysqld/mysqld.pid
--socket=/var/run/mysqld/mysqld.sock
--port=3306
--basedir=/usr
--datadir=/mnt/dbstorage/mysql-data
--tmpdir=/tmp
--lc-messages-dir=/usr/share/mysql
--skip-external-locking
--key_buffer=16M
--max_allowed_packet=16M
--thread_stack=192K
--thread_cache_size=8
--myisam-recover=BACKUP
--query_cache_limit=1M
--query_cache_size=16M
--log_error=/var/log/mysql/error.log
--expire_logs_days=10
--max_binlog_size=100M
--log-bin-index=/mnt/dbstorage/mysql-misc/binlog.index
--sync_binlog=1
--innodb_buffer_pool_size=16M
--innodb_flush_log_at_trx_commit=1
--log_bin=/mnt/dbstorage/mysql-misc/binlog
--server-id=1

I found the only way to fix this is to explicitly set the log file size in my.cnf
in the [mysqld] section, add the line
innodb_log_file_size=5M

Changing 5M to whatever size your log file actually is.

The restart mysql

Be warned - changing the log file size will cause mysql to fail to start. If this happens change the size to the correct size.
If you do a full / complete mysql shutdown you can also remove the existing log files before restarting - this always works for me.

Thank you,

I’ve already found this solution too.

MySQL Server depending on version has different default value for innodb_log_file_size: 5242880 (MySQL < 5.6.8), 50331648 (MySQL >= 5.6.8) [url]MySQL :: MySQL 5.6 Reference Manual :: 14.14 InnoDB Startup Options and System Variables

Xtrabackup uses it’s own compiled defaults. Version line “xtrabackup version 2.2.3 based on MySQL server 5.6.17 Linux (x86_64) (revision id: )” is very meaningful.

You are getting this error with xtrabackup compiled against MySQL >= 5.6.8 and MySQL < 5.6.8 when you haven’t explicitly set innodb_log_file_size in my.cnf
Solution is to set correct default value in my.cnf or like you set custom size and reset logfile

Hi, I have same problem with xtrabackup 2.2.3-4982-1.wheezy on Debian 7 Wheezy.

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

Get the latest version of Percona XtraBackup, documentation, and help resources:
[url]Percona XtraBackup - MySQL Database Backup Software

140729 12:17:50 innobackupex: Connecting to MySQL server with DSN ‘dbi:mysql:;mysql_read_default_group=xtrabackup’ as ‘root’ (using password: YES).
140729 12:17:50 innobackupex: Connected to MySQL server
140729 12:17:50 innobackupex: Executing a version check against the server…
140729 12:17:50 innobackupex: Done.
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints “completed OK!”.

innobackupex: Using mysql server version 5.5.38-35.2-log

innobackupex: Created backup directory /root/2014-07-29_12-17-50

140729 12:17:50 innobackupex: Starting ibbackup with command: xtrabackup --defaults-group=“mysqld” --backup --suspend-at-end --target-dir=/root/2014-07-29_12-17-50 --tmpdir=/tmp --extra-lsndir=‘/tmp’
innobackupex: Waiting for ibbackup (pid=26112) to suspend
innobackupex: Suspend file ‘/root/2014-07-29_12-17-50/xtrabackup_suspended_2’

xtrabackup version 2.2.3 based on MySQL server 5.6.17 Linux (x86_64) (revision id: )
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /var/lib/mysql
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
InnoDB: Error: log file ./ib_logfile0 is of different size 5242880 bytes
InnoDB: than specified in the .cnf file 50331648 bytes!
innobackupex: Error: The xtrabackup child process has died at /usr/bin/innobackupex line 2672.

I use: percona-server-common-5.5 5.5.38-rel35.2-674.wheezy

Please, advice - which correct default value in my.cnf should i set based on?

Judging by the error you are getting, 5M is the right size.