mds: rename over old files should flush data or revert to old contents?
write to foo.conf.tmp
rename foo.conf.tmp to foo.conf
<crash before flushing new file content>
foo.conf now 0 bytes. :(
#8 Updated by Greg Farnum over 6 years ago
I think it does still exist?
We have an existing foo.conf, inode x
Write to foo.conf.tmp, inode y
rename foo.conf.tmp -> foo.conf
We now have inode x in the stray directory, foo.conf pointing at inode y, but no RADOS objects backing up y.
In a local FS this isn't strictly safe either (without the syncing foo.conf.tmp first), but you're a lot more likely to be okay because most local FS implementations (either deliberately or just in practice) will flush those modifications in order. With our separate paths and writeback, we don't.