Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Michael Banck <michael(dot)banck(at)credativ(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)
Date: 2021-01-06 20:03:04
Message-ID: 20210106200304.GQ27507@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

* Peter Geoghegan (pg(at)bowt(dot)ie) wrote:
> On Wed, Jan 6, 2021 at 11:44 AM Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> > Having fsync off won't actually cause corruption unless you have an OS
> > crash or don't sync the disks when you reboot the system though- so it's
> > a hedge against certain failure conditions, as is checksums.
>
> I find this argument baffling. Do you really believe this?

Do you really believe it to be wrong? Do we stop performing the correct
write calls in the correct order to the kernel with fsync being off? If
the kernel actually handles all of our write calls correctly and we
cleanly shut down and the kernel cleanly shuts down and sync's the disks
before a reboot, will there be corruption from running with fsync off?

If that's the case, I'd certainly be curious to hear under what
conditions, when everything works, we'll end up with corruption simply
from running with fsync off.

I don't mean to imply that I advocate for such- I'd hope that it would
be clear from this discussion that I'm not suggesting that we turn fsync
off, and rather the opposite, that we have both fsync and data checksums
be on by default, but to claim that having fsync off will always, in
every situation, cause corruption is over-stating the case.

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2021-01-06 20:16:21 Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)
Previous Message Peter Geoghegan 2021-01-06 19:53:39 Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)