List:General Discussion« Previous MessageNext Message »
From:Heikki Tuuri Date:February 23 2005 12:44am
Subject:Re: wikipedia down, slashdot covering, mysql mentioned
View as plain text  
Jochem,

----- Original Message ----- 
From: "Jochem van Dieten" <jochemd@stripped>
Newsgroups: mailing.database.myodbc
Sent: Wednesday, February 23, 2005 1:01 AM
Subject: Re: wikipedia down, slashdot covering, mysql mentioned


> On Wed, 23 Feb 2005 00:22:55 +0200, Heikki Tuuri wrote:
>>
>> a buggy fsync() in Linux is one of  the possible reasons here. If an 
>> InnoDB
>> tablespace gets corrupt in a power outage, it is most probably caused by 
>> a
>> bad fsync() implementation or configuration in the operating system or
>> hardware. An fsync() call should write the data physically to disk or to 
>> a
>> battery-backed, non-volatile disk cache. If it fails to do so, then any
>> database, PostgreSQL or anything, can get corrupt.
>
> Can they? Even if the absolute ordering of writes is maintained, only
> full pages are written and each page has a checksum? It seems to me
> that then you might lose transactions that have not yet committed to
> disk, but your database would not get corrupt.

you are right, if the disk subsystem writes database pages to the disk or a 
non-volatile cache in the same order that fsync() was called on the pages, 
then the database cannot get corrupt. Corruption could only result from a 
partial page write, and against that InnoDB uses the 'doublewrite' method:

http://dev.mysql.com/doc/mysql/en/innodb-disk-i-slash-o.html

In the Wikipedia case, the disk subsystem apparently had written partial 
pages for whom the good copy of the page was not present in the doublewrite 
buffer. That means that the writes could not physically happen in the same 
order that fsync() was called on them. Thus, fsync() was not a 'barrier' in 
disk writes.

> Jochem

Regards,

Heikki

Thread
wikipedia down, slashdot covering, mysql mentionedScott Haneda22 Feb
  • Re: wikipedia down, slashdot covering, mysql mentionedDebugasRu22 Feb
  • Re: wikipedia down, slashdot covering, mysql mentionedPeter Wilm22 Feb
  • Re: wikipedia down, slashdot covering, mysql mentionedDaniel Kasak22 Feb
    • Re: wikipedia down, slashdot covering, mysql mentionedGreg Whalin22 Feb
      • Re: wikipedia down, slashdot covering, mysql mentionedDaniel Kasak22 Feb
        • Re: wikipedia down, slashdot covering, mysql mentionedGreg Whalin23 Feb
        • Re: wikipedia down, slashdot covering, mysql mentionedDebugasRu24 Feb
          • Re: wikipedia down, slashdot covering, mysql mentionedRich Lafferty24 Feb
            • Re: wikipedia down, slashdot covering, mysql mentionedGreg Whalin24 Feb
              • Re: wikipedia down, slashdot covering, mysql mentionedRich Lafferty24 Feb
                • Re: wikipedia down, slashdot covering, mysql mentionedGreg Whalin24 Feb
              • Re[2]: wikipedia down, slashdot covering, mysql mentionedDebugasRu24 Feb
Re: wikipedia down, slashdot covering, mysql mentionedHeikki Tuuri22 Feb
  • Re: wikipedia down, slashdot covering, mysql mentionedGreg Whalin22 Feb
  • Re: wikipedia down, slashdot covering, mysql mentionedJochem van Dieten23 Feb
Re: wikipedia down, slashdot covering, mysql mentionedHeikki Tuuri23 Feb
Re: wikipedia down, slashdot covering, mysql mentionedHeikki Tuuri23 Feb
Re: wikipedia down, slashdot covering, mysql mentionedHeikki Tuuri23 Feb