Dangers of fsync = off

From: Joel Dice <dicej(at)mailsnare(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Dangers of fsync = off
Date: 2007-05-01 21:42:47
Message-ID: Pine.LNX.4.62.0705011434430.27925@joeldicepc.ecovate.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all.

It's clear from the documentation for the fsync configuration option that
turning it off may lead to unrecoverable data corruption. I'd like to
learn more about why this is possible and how likely it really is.

A quick look at xlog.h reveals that each record in the transaction log
contains a CRC checksum, a transaction ID, a length, etc.. Assuming the
worst thing that can happen due to a crash is that the end of the log is
filled with random garbage, there seems to be little danger that the
recovery process will misinterpret any of that garbage as a valid
transaction record, complete with matching checksum.

If my assumption is incorrect (i.e. garbage at the end of the log is not
the worst that can happen), what else might happen, and how would this
lead to unrecoverable corruption? Also, are there any filesystems
available which avoid such cases?

Sorry if this has been discussed before - in which case please point me to
that discussion.

Thanks.

- Joel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Reece Hart 2007-05-01 21:47:09 Re: IF function?
Previous Message Jeff Davis 2007-05-01 21:19:08 Re: STDERR vs. SYSLOG logging