Re: initdb and fsync - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: initdb and fsync
Date
Msg-id 1339584783.11971.28.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: initdb and fsync  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: initdb and fsync  (Jeff Davis <pgsql@j-davis.com>)
List 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.




pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: Minimising windows installer password confusion
Next
From: Andres Freund
Date:
Subject: [RFC][PATCH] Logical Replication/BDR prototype and architecture