directories' timestamps in snapshots sometimes change when directory is modified
When trying to load a series of backups from directories trees large and small, I noticed one particularly undesirable effect: the timestamps of directories within the snapshot tree appear to change, but only sometimes, when the corresponding directories are modified in some way I haven't been able to track down. I haven't come up with a reliable reproducer yet, but the way I've triggered the bug was like this:
for snapshot in 1 2 3 ...; do rsync -aHv --del /path/to/src/$snapshot/ /mnt/ceph/test/ mkdir /mnt/ceph/test/.snap/$snapshot # I actually use ..snap.. instead of .snap, in a ceph-fuse mount done # days later, after restarting mds and remounting (not sure either is needed to trigger the bug) for snapshot in 1 2 3 ...; do rsync -aHv --del /path/to/src/$snapshot/ /mnt/ceph/test/.snap/$snapshot/ # fails to set times on various directories done
#2 Updated by Alexandre Oliva almost 12 years ago
I'm not sure this was a dupe, but I can see why it would seem like it.
When I reported this, plenty of directories within the snapshot had lost their expected timestamps. I haven't been able to duplicate this behavior any more. Oddly, the only directory whose timestamp still changes upon mds restarts is the root of the snapshot. So this may be a different problem, or it could actually be the same.
Now, given my understanding of how snapshots are implemented, I can't make sense of why the roots would be special in this regard. It seems that the fix sage suggested for 1946 would be required to avoid the problem with subdirs of the snapshot root or, conversely, that if we get subdirs right we should get the root right as well. I'm thoroughly confused ATM; advise would be welcome. In the mean time, I'll keep on studying the MDS code.