Re: initdb and fsync

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: initdb and fsync
Date: 2012-06-13 10:53:03
Message-ID: 1339584783.11971.28.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On tis, 2012-06-12 at 21:09 -0700, Jeff Davis wrote:
> On Sun, 2012-03-25 at 19:59 -0700, Jeff Davis wrote:
> > On Sat, 2012-03-17 at 17:48 +0100, Cédric Villemain wrote:
> > > I agree with Andres.
> > >
> > >
> > > I believe we should use sync_file_range (_before?) with linux.
> > >
> > > And we can use posix_fadvise_dontneed on other kernels.
> > >
> > OK, updated patch attached. sync_file_range() is preferred,
> > posix_fadvise() is a fallback.
> >
>
> Rebased patch attached. No other changes.

The --help output for the -N option was copy-and-pasted wrongly.

The message issued when using -N is also a bit content-free. Maybe
something like

"Running in nosync mode. The data directory might become corrupt if the
operating system crashes.\n"

Which leads to the question, how does one get out of this state? Is
running sync(1) enough? Is starting the postgres server enough?

There are no updates to the initdb man page included in your patch,
which would be a suitable place to discuss this briefly.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-06-13 11:27:23 [RFC][PATCH] Logical Replication/BDR prototype and architecture
Previous Message Florian Pflug 2012-06-13 10:32:03 Re: Minimising windows installer password confusion