Mehdi Akiki

Posts tagged "what survives a crash"

  • Published on

    Investigation · Part 5 of 20 · What survives a crash

    The Zero-Length File Problem and What ext4 Does About It

    In 2009, ext4 users found empty files after crashes, and ext4 got a heuristic called auto_da_alloc. I watched it work on my laptop: a rename over an existing file starts the writeback at once. It protects against the worst case, but it is not durability.
  • Published on

    Investigation · Part 4 of 20 · What survives a crash

    Why the Directory Needs fsync Too

    fsync of a new file does not promise that its name is on the disk. I measured directory fsync on ext4: half a microsecond after a file fsync, about 420 microseconds after a rename, and alone it made the name durable while the data stayed in RAM.
  • Published on

    Investigation · Part 3 of 20 · What survives a crash

    How to Save a File Without Losing It: Write, fsync, Rename

    I killed a program 300 times while it saved a file. Writing in place left a cut file 233 times, without any power loss. A temp file, fsync and rename never did. Then I traced how sed, Python, cp, install and git save files.
  • Published on

    Investigation · Part 2 of 20 · What survives a crash

    What fsync Costs on a Laptop SSD

    I measured 1,000 rounds of a 4 KiB write followed by a sync on my laptop: about 540 microseconds for an append, 208 for an overwrite in place, a slowest round eleven times the median, and 3.6 microseconds on tmpfs, where fsync waits for nothing.
  • Published on

    Investigation · Part 1 of 20 · What survives a crash

    Your Data Is Not on Disk When write() Returns

    When write returns, the kernel has your data, but the disk does not have it yet. I measured it on my laptop: 256 MiB sat in RAM until fsync, kill -9 lost nothing, and a power cut could lose everything for up to about 35 seconds.