3 ms·
Right, but it can sync arbitrary ranges sooner, which is also awful for consistency.
by monocasa 6y ago
Right, but it can sync arbitrary ranges sooner, which is also awful for consistency.
- reader_mode 6y agoShouldn't your write strategy be resilient to that kind of stuff (eg. shutdown during a partial update) ?
- gmueckl 6y agoDon't you need exact guarantees on write ordering to achieve that?
- bonzini 6y agoYou can do write/sync/write/sync in order to achieve that. It would be nicer to have FUA support in system calls (or you can open the same file to two descriptors, one with O_SYNC and one without).
- jorangreef 6y agoYes, for almost all databases, although there was a cool paper from the University of Wisconsin Madison a few years ago that showed how to design something that could work without write barriers, and under the assumption that disks don't always fsync correctly: "the No-Order File System (NoFS), a simple, lightweight file system that employs a novel technique called backpointer based consistency to provide crash consistency without ordering writes as they go to disk" http://pages.cs.wisc.edu/~vijayc/nofs.htm http://pages.cs.wisc.edu/~vijayc/nofs.htm
- vlovich123 6y agoDoes that generalize to databases? My understanding is that file systems are a restricted case of databases that don’t necessarily support all operations (eg transactions are smaller, can’t do arbitrary queries within a transaction, etc etc).
- jorangreef 6y agoI think it would, because if your underlying file system can provide crash consistency then that can be leveraged as a primitive by the database.