Empty directory is not backed when stream is used

Bug #1217426 reported by Raghavendra D Prabhu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Fix Released
Medium
Alexey Kopytov
2.0
Won't Fix
Undecided
Unassigned
2.1
Fix Released
Medium
Alexey Kopytov
2.2
Fix Released
Medium
Alexey Kopytov

Bug Description

When using innobackupex --stream=xbstream, the empty directory - in this case test - doesn't seemed to backed up. This can lead to node inconsistency with PXC and elsewhere. It is backed up correctly when local backup is done.

Tags: pxc

Related branches

Revision history for this message
Alexey Kopytov (akopytov) wrote :

I don't think it is specific to xbstream or streaming backups in general. XtraBackup copies files and creates directories if necessary. I don't think a directory will be created in the backup if it's empty, be it xbstream, or tar, or local backups.

I though we had a similar report for local backups, but I can't find it now.

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

I am not able to repeat this for local backups.

However, this can break replication when:

node1: has empty test database.

node2 SSTs from node1

node1 now creates a table in test database

node2 dies with 'no test database'.

This is for PXC, however, this replication breakage can happen in mysql master-slave as well.

tags: added: pxc
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Actually, is this a hypothetical scenario, or something that you can reproduce?

I'm not able to reproduce it neither with streaming nor with local backups, because an empty database also contains a db.opt file, which is copied by innobackupex and thus results in the directory being created in the backup.

mysql> create database foo;

$ ls /data/56/usr/local/mysql/data/foo
db.opt

# xbstream backup
$ ./innobackupex --socket=/tmp/mysql.sock --user=root --stream=xbstream /tmp | xbstream -x -C /tmp/backup/
...
$ ls /tmp/backup/foo/
db.opt

$ rm -rf /tmp/backup

# Local backup
$ ./innobackupex --socket=/tmp/mysql.sock --user=root --no-timestamp /tmp/backup
...
$ ls /tmp/backup/foo/
db.opt

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

Above doesn't apply for default test database as that is empty by default. (not sure why).

This is after a fresh mysql_install_db.

http://paste.wnohang.net/feed31

Revision history for this message
Alexey Kopytov (akopytov) wrote :

OK, thanks.

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-662

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.