Empty directory is not backed when stream is used

Reported by Raghavendra D Prabhu on 2013-08-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup
Status tracked in 2.2
2.0
Undecided
Unassigned
2.1
Medium
Alexey Kopytov
2.2
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 Edit Tag help
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.

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
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

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

Alexey Kopytov (akopytov) wrote :

OK, thanks.

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

Other bug subscribers