Does your host flush?

While investigating a friend’s report of ext3/InnoDB corruption in a Ubuntu VirtualBox guest, when his OS X host machine crashed, I discovered that by default, VirtualBox does not do anything about IDE Flush Cache commands. The natural implication of this, which I have been able to reproduce, is that your journaled and transactional guest systems cannot maintain integrity if the host crashes. (For longer reasoning see that forum post.) It’s as if you were running them on broken hardware.
This can corrupt InnoDB – which under normal circumstances recovers fine from crashes. You can imagine what it could do to MyISAM :)
So this post is just a headsup – even if you’re only doing development in VB – unless you want to risk nasty surprises, I strongly recommend you disable the IgnoreFlush option in VirtualBox. See “Responding to guest IDE flush requests,” in the VirtualBox manual.
This issue may also affect other virtualisation hosts.
While investigating a friend’s report of ext3/InnoDB corruption in a Ubuntu VirtualBox guest, when his OS X host machine crashed, I discovered that by default, VirtualBox does not do anything about IDE Flush Cache commands. A risk of thisĀ is that your journaled and transactional guest systems risk corruption if the host crashes. (For longer reasoning see that forum post.) It’s as if you were running them on broken hardware.
Even if you’re only doing development in VB – to reduce the chance of a nasty surprise, I recommend you disable the IgnoreFlush option in VirtualBox. See “Responding to guest IDE flush requests,” in the VirtualBox manual.
This issue may also affect other virtualisation hosts.

4 Responses to “Does your host flush?”

  1. Hmmm, the link seems to be wrong. The correct one seems to be:

    http://www.virtualbox.org/manual/UserManual.html#id2531504

    Thanks for the great info!

  2. Thanks for the headsup. I’ve fixed the link.

  3. I actually heard somewhere that OS X also doesn’t really flush…

  4. @Nils
    It makes a pretty good effort, according to: http://lists.apple.com/archives/darwin-dev/2005/Feb/msg00072.html

    (via an old post of mine, http://groups.google.com/group/comp.unix.solaris/msg/4817a85b71816f98 )

Leave a Comment