innobackupex "completed OK" when backing up a "remote" server
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB |
Opinion
|
Undecided
|
Unassigned |
Bug Description
I've come across a situation where it was attempted to backup a remote server by providing --host and MySQL credentials to access the target server remotely, like running below command from server 192.168.70.2:
[root@node1 mysql]# innobackupex --host 192.168.70.3 --user=fernando --password=XXXXXX /tmp
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://
151006 23:48:33 innobackupex: Executing a version check against the server...
151006 23:48:33 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:
151006 23:48:33 innobackupex: Connected to MySQL server
151006 23:48:33 innobackupex: Done.
151006 23:48:33 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:
151006 23:48:33 innobackupex: Connected to MySQL server
151006 23:48:33 innobackupex: Starting the backup operation
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!".
innobackupex: Using server version 5.6.24-72.2-56
innobackupex: Created backup directory /tmp/2015-
151006 23:48:33 innobackupex: Starting ibbackup with command: xtrabackup --defaults-
innobackupex: Waiting for ibbackup (pid=12831) to suspend
innobackupex: Suspend file '/tmp/2015-
xtrabackup version 2.2.12 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 8726828)
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_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
>> log scanned up to (1601046)
xtrabackup: Generating a list of tablespaces
[01] Copying ./ibdata1 to /tmp/2015-
[01] ...done
>> log scanned up to (1601046)
xtrabackup: Creating suspend file '/tmp/2015-
151006 23:48:35 innobackupex: Continuing after ibbackup has suspended
151006 23:48:35 innobackupex: Executing LOCK TABLES FOR BACKUP...
151006 23:48:35 innobackupex: Backup tables lock acquired
151006 23:48:35 innobackupex: Starting to backup non-InnoDB tables and files
innobackupex: in subdirectories of '/var/lib/mysql/'
151006 23:48:35 innobackupex: Finished backing up non-InnoDB tables and files
151006 23:48:35 innobackupex: Executing LOCK BINLOG FOR BACKUP...
151006 23:48:35 innobackupex: Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
151006 23:48:35 innobackupex: Waiting for log copying to finish
>> log scanned up to (1601046)
xtrabackup: The latest check point (for incremental): '1601046'
xtrabackup: Stopping log copying thread.
.>> log scanned up to (1601046)
xtrabackup: Creating suspend file '/tmp/2015-
xtrabackup: Transaction log of lsn (1601046) to (1601046) was copied.
151006 23:48:36 innobackupex: Executing UNLOCK BINLOG
151006 23:48:36 innobackupex: Executing UNLOCK TABLES
151006 23:48:36 innobackupex: All tables unlocked
innobackupex: Backup created in directory '/tmp/2015-
151006 23:48:36 innobackupex: Connection to database server closed
151006 23:48:36 innobackupex: completed OK!
It's surprising that it "completed OK" considering there was no mysqld running on the host from where I ran innobackupex, even though there was an existing /etc/my.cnf file and the datadir referenced by it contained:
[root@node1 mysql]# ls -l
total 110592
-rw-r----- 1 mysql mysql 12582912 Oct 6 23:47 ibdata1
-rw-r--r-- 1 mysql mysql 50331648 Oct 6 23:48 ib_logfile0
-rw-r--r-- 1 mysql mysql 50331648 Oct 6 23:48 ib_logfile1
If we attempt to have the backup prepared, it "completes OK" as well:
[root@flc-node1 mysql]# innobackupex --apply-log /tmp/2015-
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://
151006 23:48:53 innobackupex: Starting the apply-log operation
IMPORTANT: Please check that the apply-log run completes successfully.
At the end of a successful apply-log run innobackupex
prints "completed OK!".
151006 23:48:53 innobackupex: Starting ibbackup with command: xtrabackup --defaults-
xtrabackup version 2.2.12 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 8726828)
xtrabackup: cd to /tmp/2015-
xtrabackup: This target seems to be not prepared yet.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(1601046)
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: Using atomics to ref count buffer pool pages
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Memory barrier is not used
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Not using CPU crc32 instructions
InnoDB: Initializing buffer pool, size = 100.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Highest supported file format is Barracuda.
InnoDB: 128 rollback segment(s) are active.
InnoDB: Waiting for purge to start
InnoDB: 5.6.24 started; log sequence number 1601046
[notice (again)]
If you use binary log and don't use any hack of group commit,
the binary log position seems to be:
xtrabackup: Recovered WSREP position: 00000000-
xtrabackup: starting shutdown with innodb_
InnoDB: FTS optimize thread exiting.
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 1601056
151006 23:48:55 innobackupex: Restarting xtrabackup with command: xtrabackup --defaults-
for creating ib_logfile*
xtrabackup version 2.2.12 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 8726828)
xtrabackup: cd to /tmp/2015-
xtrabackup: This target seems to be already prepared.
xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: using the following InnoDB configuration for recovery:
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: innodb_
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
InnoDB: Using atomics to ref count buffer pool pages
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Memory barrier is not used
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Not using CPU crc32 instructions
InnoDB: Initializing buffer pool, size = 100.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Setting log file ./ib_logfile101 size to 48 MB
InnoDB: Setting log file ./ib_logfile1 size to 48 MB
InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
InnoDB: New log files created, LSN=1601056
InnoDB: Highest supported file format is Barracuda.
InnoDB: 128 rollback segment(s) are active.
InnoDB: Waiting for purge to start
InnoDB: 5.6.24 started; log sequence number 1601548
[notice (again)]
If you use binary log and don't use any hack of group commit,
the binary log position seems to be:
xtrabackup: starting shutdown with innodb_
InnoDB: FTS optimize thread exiting.
InnoDB: Starting shutdown...
InnoDB: Shutdown completed; log sequence number 1601558
151006 23:48:57 innobackupex: completed OK!
Resulting in:
[root@node1 mysql]# ls -l /tmp/2015-
total 112656
-rw-r--r-- 1 root root 358 Oct 6 23:48 backup-my.cnf
-rw-r----- 1 root root 12582912 Oct 6 23:48 ibdata1
-rw-r--r-- 1 root root 50331648 Oct 6 23:48 ib_logfile0
-rw-r--r-- 1 root root 50331648 Oct 6 23:48 ib_logfile1
-rw-r----- 1 root root 89 Oct 6 23:48 xtrabackup_
-rw-r--r-- 1 root root 39 Oct 6 23:48 xtrabackup_
-rw-r--r-- 1 root root 542 Oct 6 23:48 xtrabackup_info
-rw-r----- 1 root root 2097152 Oct 6 23:48 xtrabackup_logfile
This was tested in a server with:
$ rpm -qa |grep -i percona
Percona-
Percona-
Percona-
percona-
Percona-
Percona-
percona-
percona-
I've also tried with percona-
Ideally we should improve pre-run "health check" and raise errors in such situation.
What would be the check we might perform? I can only suggest that xtrabackup will ask server to create a file and check if this file is accessible. SELECT INTO OUTFILE would do the trick, but it will impose additional requirements on MySQL server configuration and xtrabackup user grants.