[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: Thomas Steffen
Subject: Re: [Qemu-devel] Ensuring data is written to disk
Date: Mon, 7 Aug 2006 20:13:57 +0200

On 8/7/06, R. Armiento <address@hidden> wrote:
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.

And some IDE disks do not let you switch off write-caching. So as far
as I know, you need SCSI for transactional guarantees. SATA might
work, but since so many things "should work" and then don't in SATA, I
would be very careful.

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.

I have heard this before. Basically, the OS can interprete the fsync
command as a request to flush all caches, or it can interprete it as a
write barrier. The later gives much higher performance and guarantees
the consistency of the disk content, but it does not guarantee the
consistency with the rest of the world. My impression was that Linux
only does the later, but I did not find a lot of information on this.

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

I don't have any problems with that. Both MySQL and ext3 are
transaction safe if used on a correct disk (SCSI). But if your disk
does not handle sync correctly, then the resulting system cannot be
transaction safe.

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.

If qemu works correctly: yes. It would be interesting to test that.

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.

Correct, and MyISAM is much more popular, because it is faster.


reply via email to

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