Empty directory is not backed when stream is used

Bug #1217426 reported by Raghavendra D Prabhu on 2013-08-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona XtraBackup
Alexey Kopytov
Alexey Kopytov
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

Related branches

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

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

$ rm -rf /tmp/backup

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

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.


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