3 ms·
Yeah, mv is atomic but I believe that a crash can still leave your data inconsistent due to write reordering, see: http://comments.gmane.org/gmane.os.solaris.o
by praptak 14y ago
Yeah, mv is atomic but I believe that a crash can still leave your data inconsistent due to write reordering, see:
http://comments.gmane.org/gmane.os.solaris.opensolaris.zfs/25120 http://comments.gmane.org/gmane.os.solaris.opensolaris.zfs/2...
I would do a fsync() before switching the symlink to the new dir.
- ibotty 14y agoyes. that's a good idea if you care about it. the good part about this solution is that even if the newly deployed file tree becomes corrupted, you can simply point the symlink to the old (certainly not corrupt) tree. that is easy and fast error recovery. an fsync in between makes the window very small, so that only the symlink might get broken.