Gtid_purged and Gtid_executed values not cleared when backup is taken from an instance with running transactions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona XtraBackup moved to https://jira.percona.com/projects/PXB |
Triaged
|
Medium
|
Borys Belinsky |
Bug Description
[root@centos5 ~]# mysql -e 'show global variables like "gtid_%"';
+------
| Variable_name | Value |
+------
| gtid_executed | 8eafa203-
| gtid_executed_
| gtid_mode | ON |
| gtid_owned | |
| gtid_purged | |
+------
[root@centos5 ~]# innobackupex --user=root /var/lib/backups/ 2> ~/backup.log
[root@centos5 ~]# service mysql stop
Stopping mysqld: [ OK ]
[root@centos5 ~]# rm -rf /var/lib/mysql/*
[root@centos5 ~]# innobackupex --apply-log /var/lib/
[root@centos5 ~]# innobackupex --copy-back /var/lib/
[root@centos5 ~]# chown -R mysql:mysql /var/lib/mysql
[root@centos5 ~]# tail -1 backup.log
160608 03:59:55 completed OK!
[root@centos5 ~]# tail -1 prepare.log
160608 04:02:12 completed OK!
[root@centos5 ~]# tail -1 copyback.log
160608 04:02:39 completed OK!
[root@centos5 ~]# service mysql start
Starting mysqld: [ OK ]
[root@centos5 ~]# mysql -e 'show global variables like "gtid_%"';
+------
| Variable_name | Value |
+------
| gtid_executed | 8eafa203-
| gtid_executed_
| gtid_mode | ON |
| gtid_owned | |
| gtid_purged | 8eafa203-
+------
[root@centos5 ~]# mysql -e 'select @@version, @@version_comment'
+------
| @@version | @@version_comment |
+------
| 5.7.11-4-log | Percona Server (GPL), Release 4, Revision 5c940e1 |
+------
On an instance where no transactions are running backup and restore will result in an empty gtid_purged and gtid_executed variables.
How to test:
Install MySQL 5.7 and PXB 2.4.3
Run OLTP sysbench test
Take a backup while sysbench is running.
Why this matters? Normal expected behavior is gtid_executed and gtid_purged should be empty upon restore and user will just have to follow instructions in Step 4 in https:/
Changed in percona-xtrabackup: | |
status: | Invalid → New |
Changed in percona-xtrabackup: | |
status: | Confirmed → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Hrvoje Matijakovic (hrvojem) |
tags: | added: doc |
Changed in percona-xtrabackup: | |
assignee: | Hrvoje Matijakovic (hrvojem) → Borys Belinsky (borys-belinsky-percona) |
PXB 2.3.4 on PS 5.6.30 does not show this problem:
[root@centos1 ~]# mysql -e 'show global variables like "gtid_%"' ------- ------- --+---- ------- ------- ------- ------- ------- ------+ ------- ------- --+---- ------- ------- ------- ------- ------- ------+ _step | OFF | 2d55-11e6- ba79-feef2c35fb dc:1-6511 | ------- ------- --+---- ------- ------- ------- ------- ------- ------+ backups/ 2016-06- 08_04-49- 35/ 2> prepare.log backups/ 2016-06- 08_04-49- 35/ 2> copyback.log ------- ------- --+---- ---+ ------- ------- --+---- ---+ _step | OFF | ------- ------- --+---- ---+
+------
| Variable_name | Value |
+------
| gtid_deployment
| gtid_executed | 995255ef-
| gtid_mode | ON |
| gtid_owned | |
| gtid_purged | |
+------
[root@centos1 ~]# innobackupex --user=root --host=127.0.0.1 --port=3306 /var/lib/backups/ 2> backup.log
[root@centos1 ~]# innobackupex --apply-log /var/lib/
[root@centos1 ~]# service mysql stop
Shutting down MySQL (Percona Server).... SUCCESS!
[root@centos1 ~]# rm -rf /var/lib/mysql/*
[root@centos1 ~]# innobackupex --copy-back /var/lib/
[root@centos1 ~]# chown -R mysql:mysql /var/lib/mysql
[root@centos1 ~]# service mysql start
Starting MySQL (Percona Server). SUCCESS!
[root@centos1 ~]# mysql -e 'show global variables like "gtid_%"'
+------
| Variable_name | Value |
+------
| gtid_deployment
| gtid_executed | |
| gtid_mode | ON |
| gtid_owned | |
| gtid_purged | |
+------