linux - Possible to implement journaling with a single fsync per commit? -


Assume that you are creating a journaling / writing-forward-logging storage system. Can you write data (for each transaction) by adding data (with typed (2)), adding a commercial marker, and then fsincng?

The scenario is to consider if you write this log bigger then it writes to FSIIN, and fails during FSIIN is a failure. Are Inode Direct / Indirect Block Points Used To Fly All Data Blocks Only After Fly, Or Is There Any Guarantee That Blocks Have Flyed In Order? If the latter, then during the recovery, if you see a commercial marker at the end of the file, then you can not believe that the data between it and the previous mark marker is meaningful. In this way, you have to depend on any other mechanism (involving at least other FSIINs) in how much the log file is compatible (for example, writing data / freshening, then writing / phishing commercial markers).

If it makes a difference, mainly thinking about ext3 / ext4 as a reference.

Note that the FSINCC and FDATASIC of Linux and Mac OS are incorrect by default. Windows is correct by default, but it can emulate Linux for benchmarking purposes.

In addition, if you attach at the end of a file, the Vladivsk writes more than one disk, because the file needs to update the inode with a new length. If you want to write a committed copy, then your best bet is to allocate the log location first, store the CRC of the log entries in the committed marker and issue a single fadatacink () on the commit. In this way, whether behind your back OS / hardware re-order, you can find the suffix of the log that actually hits the disk.

If you want to use a log for a durable commission or write forward, things get tougher, because you need to make sure that fsync actually works. Under Linux, you want to disable the disk writing cache with hdparm or set the partition with Bayer to True. [Edit: I am standing right and the obstacle is not giving the right words. SATA and SCSI present many types of primitive introductions, such as writing constraints and local command queues, which are possible to export priorities for the operating system What makes that write-forward logging enabled, what can I say from the manpage and online, linux not only for userspace but filesystems Tom exposes to developers.]

Ironically, disabling disk writing cache sometimes leads to better performance, because you get more control over typing scheduling in user location; If the disc puts a bunch of synchronous write requests, then you uncover the strange latency spike in the application. Disabling writing cache prevents this from happening.

Finally, the real system groups use the commit, and the & lt; Write less SIM with concurrent workloads.


Comments