xtrabackup_binlog_pos_innodb provides a wrong position if no DML has been executed right after a DDL
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB |
Invalid
|
Undecided
|
Unassigned |
Bug Description
To test:
[user@sandbox msb_5_6_25]$ mysql --port=5625 test
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.25-73.1-log Percona Server (GPL), Release 73.1, Revision 07b797f
Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create table t1(a int);
Query OK, 0 rows affected (0.08 sec)
mysql> insert into t1 values(1);
Query OK, 1 row affected (0.02 sec)
mysql> create table t2(a int);
Query OK, 0 rows affected (0.02 sec)
mysql> create table t3(a int);
Query OK, 0 rows affected (0.03 sec)
mysql> quit
Run and prepare backup:
[root@sandbox ~]# innobackupex --port=5625 --host=127.0.0.1 --user=root --password=msandbox --no-lock /backups
cd /backups/
[root@sandbox ~]# innobackupex --apply-log .
Compare xtrabackup_
[root@sandbox 2015-08-
mysql-bin.000001 424
[root@sandbox 2015-08-
mysql-bin.000001 616
Binary log info:
[root@sandbox 2015-08-
/*!50530 SET @@SESSION.
/*!40019 SET @@session.
/*!50003 SET @OLD_COMPLETION
DELIMITER /*!*/;
# at 4
#150811 1:45:09 server id 1 end_log_pos 120 CRC32 0x9900a135 Start: binlog v 4, server v 5.6.25-73.1-log created 150811 1:45:09 at startup
# Warning: this binlog is either in use or was not closed properly.
ROLLBACK/*!*/;
BINLOG '
JePIVQ8BAAAAdAA
AAAAAAAAAAAAAAA
AJk=
'/*!*/;
# at 120
#150811 1:45:54 server id 1 end_log_pos 216 CRC32 0x2a7564f6 Query thread_id=3 exec_time=0 error_code=0
use `test`/*!*/;
SET TIMESTAMP=
SET @@session.
SET @@session.
SET @@session.
SET @@session.
/*!\C utf8 *//*!*/;
SET @@session.
SET @@session.
SET @@session.
create table t1(a int)
/*!*/;
# at 216
#150811 1:46:01 server id 1 end_log_pos 295 CRC32 0x3cba96f4 Query thread_id=3 exec_time=0 error_code=0
SET TIMESTAMP=
BEGIN
/*!*/;
# at 295
#150811 1:46:01 server id 1 end_log_pos 393 CRC32 0xcf8e1536 Query thread_id=3 exec_time=0 error_code=0
SET TIMESTAMP=
insert into t1 values(1)
/*!*/;
# at 393
#150811 1:46:01 server id 1 end_log_pos 424 CRC32 0x19927c7b Xid = 11
COMMIT/*!*/;
# at 424
#150811 1:46:06 server id 1 end_log_pos 520 CRC32 0xfa1830ef Query thread_id=3 exec_time=0 error_code=0
SET TIMESTAMP=
create table t2(a int)
/*!*/;
# at 520
#150811 1:46:09 server id 1 end_log_pos 616 CRC32 0xf2f7dce9 Query thread_id=3 exec_time=0 error_code=0
SET TIMESTAMP=
create table t3(a int)
/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_
/*!50530 SET @@SESSION.
The consequence of using coordinates from xtrabackup_
tags: | added: i66589 |
Verified with PS 5.6 and Xtrabackup 2.2.12.
nilnandan@ desktop: ~$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 75
Server version: 5.6.25-73.1-log Percona Server (GPL), Release 73.1, Revision 07b797f
Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> create table t1(a int);
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t1 values(1);
Query OK, 1 row affected (0.00 sec)
mysql> create table t2(a int);
'Query OK, 0 rows affected (0.02 sec)
mysql> create table t3(a int);
Query OK, 0 rows affected (0.01 sec)
mysql> quit desktop: ~$
Bye
nilnandan@
Took and prepare the backup.
root@desktop: /home/nilnandan /backup/ 2015-08- 11_11-58- 04# cat xtrabackup_ binlog_ info /home/nilnandan /backup/ 2015-08- 11_11-58- 04# cat xtrabackup_ binlog_ pos_innodb /home/nilnandan /backup/ 2015-08- 11_11-58- 04#
mysql-bin.000040 616
root@desktop:
mysql-bin.000040 424
root@desktop:
root@desktop: /var/lib/ mysql# mysqlbinlog mysql-bin.000040 PSEUDO_ SLAVE_MODE= 1*/; max_insert_ delayed_ threads= 0*/; _TYPE=@ @COMPLETION_ TYPE,COMPLETION _TYPE=0* /; AAHgAAAABAAQANS 42LjI1LTczLjEtb G9nAAAAAAAAAAAA AAAAAAAAAAAAAAA A AAAAAAAAAEzgNAA gAEgAEBAQEEgAAX AAEGggAAAAICAgC AAAACgoKGRkAAYM a 1439274444/ *!*/; pseudo_ thread_ id=75/* !*/; foreign_ key_checks= 1, @@session. sql_auto_ is_null= 0, @@session. unique_ checks= 1, @@session. autocommit= 1/*!*/; sql_mode= 1073741824/ *!*/; auto_increment_ increment= 1, @@session. auto_increment_ offset= 1/*!*/; character_ set_client= 33,@@session. collation_ connection= 33,@@session. collation_ server= 8/*!*/; lc_time_ names=0/ *!*/; collation_ database= DEFAULT/ *!*/; 1439274448/ *!*/; 1439274448/ *!*/; 1439274451/ *!*/;
/*!50530 SET @@SESSION.
/*!40019 SET @@session.
/*!50003 SET @OLD_COMPLETION
DELIMITER /*!*/;
# at 4
#150811 11:57:05 server id 1 end_log_pos 120 CRC32 0x56591a83 Start: binlog v 4, server v 5.6.25-73.1-log created 150811 11:57:05
# Warning: this binlog is either in use or was not closed properly.
BINLOG '
uZXJVQ8BAAAAdAA
AAAAAAAAAAAAAAA
WVY=
'/*!*/;
# at 120
#150811 11:57:24 server id 1 end_log_pos 216 CRC32 0x2b22d4a6 Query thread_id=75 exec_time=0 error_code=0
use `test`/*!*/;
SET TIMESTAMP=
SET @@session.
SET @@session.
SET @@session.
SET @@session.
/*!\C utf8 *//*!*/;
SET @@session.
SET @@session.
SET @@session.
create table t1(a int)
/*!*/;
# at 216
#150811 11:57:28 server id 1 end_log_pos 295 CRC32 0x06be9ec9 Query thread_id=75 exec_time=0 error_code=0
SET TIMESTAMP=
BEGIN
/*!*/;
# at 295
#150811 11:57:28 server id 1 end_log_pos 393 CRC32 0xac91be1b Query thread_id=75 exec_time=0 error_code=0
SET TIMESTAMP=
insert into t1 values(1)
/*!*/;
# at 393
#150811 11:57:28 server id 1 end_log_pos 424 CRC32 0x9b920b8b Xid = 238
COMMIT/*!*/;
# at 424
#150811 11:57:31 server id 1 end_log_pos 520 CRC32 0x11b2d0bd Query thread_id=75 exec_time=0 error_code=0
SET TIMESTAMP=
create table t2(a int)
/*!*/;
# ...