[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Ensuring data is written to disk

From: R. Armiento
Subject: Re: [Qemu-devel] Ensuring data is written to disk
Date: Mon, 07 Aug 2006 15:11:40 +0200
User-agent: Thunderbird (X11/20060615)

Jens Axboe wrote:
On Tue, Aug 01 2006, Jamie Lokier wrote:
Should we change to only reiserfs and expect fsync() to commit data
reliably only with that fs?  I realise this is a lot of difficult
questions, that apply to more than just Qemu...

Yes, reiser is the only one that works reliably across power loss with
write back caching for the journal commits as well as fsync guarantees.

So, just to get this further clarified:

Lets assume this typical website setup: HARDWARE: commodity SATA/PATA; drive cache is not battery backed up. HOST OS: late Linux 2.6 kernel (e.g. 2.6.15), directly, on top of host, a recent version of database software (e.g. MySQL 5.1). Running in ~ 'production'.

Now, if I understand the foregoing discussion: the *only* way of running this setup with 'full' transactional guarantees on power loss, without having to change/patch the Linux kernel, is to turn off write-caching? And that severely decreases performance.

To reiterate the foregoing discussion: fsync in ext3 only goes to the drive cache. ResiserFS v3, which is included in the kernel, does not guarantee data integrity on power loss. Reiser4 requires a kernel patch that the developers do not yet recommend for production use, see e.g. http://www.namesys.com/download.html . Furthermore (if I am not mislead) the XFS or JFS versions included in the kernel does not guarantee data integrity on power loss (Please reply and prove me wrong, even flames are welcome :). Hence, the best bet is Jamie Lokier's one line ext3 patch, see:
and then run ext3 in fully journaled mode (add data=journal to the mount options). In the 'unusual' case where it is enough with just database integrity, but acceptable that transactions may disappear on power loss, one can run ext3 in default mode.

This is somewhat surprising to me, given claims of data integrity made by both ext3 and MySQL documentation.

And then, on top of this, if one instead runs the database in a QEMU with a late Linux 2.6 kernel, one are just making data-loss more likely, right? So QEMU is in no way to blame for any of this.

For people following this discussion (perhaps suitable for QEMU docs): To disable write-caching on HOST and GUEST os:es; Make sure
      hdparm -W0 [device]
is run each bootup. On Debian/Ubuntu you do this by editing
and uncomment the line:
      write_cache = off
However, this severely decreases performance. Also note: in MySQL the MyISAM table type still does not guarantee no data loss; you need innoDB for that.

Best regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]