freezer-agent: timestamped directories don't work as expected
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Backup/Restore and DR (Freezer) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When creating backups, freezer-agent places backup data inside a directory corresponding to the timestamp of the _first_ backup of a given name. This doesn't make sense to me.
Steps to reproduce (hostname is 'manager'):
$ src_a=$(mktemp -d)
$ src_b=$(mktemp -d)
$ storage=$(mktemp -d)
$ touch $src_a/{a,b,c}
$ touch $src_b/{d,e,f}
The first backup works as expected:
$ freezer-agent \
--container $storage \
--storage local \
$ ls $storage
a.json manager_test/
$ ls $storage/
1466542080/
$ ls $storage/
manager_
The second backup creates metadata as expected but places the actual backup data in the wrong directory:
$ freezer-agent \
--container $storage \
--storage local \
$ ls $storage
a.json b.json manager_test/
$ ls $storage/
1466542080/
$ ls $storage/
manager_
tar_
Now there's a backup with a mismatched timestamp in the same directory as the first backup, but I'd expect that the backup with timestamp 'xxx126' would be in a directory named 'xxx126'. At first glance it even appears that the second backup failed entirely (though thankfully restore seems resilient to this behavior given `find_all(...)` ignores the timestamp).
My feeling is that we should either a) put each backup in its own directory as expected, b) not put them in a timestamped subdirectory at all, or c) at least document this behavior as-is.
It turns out that this is a result of the default incremental backup functionality. Passing '--no-incremental' makes everything work as expected.