Re: [COMMITTERS] Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after - Mailing list pgsql-hackers

From Greg Stark
Subject Re: [COMMITTERS] Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after
Date
Msg-id 407d949e1002281000q648770eegff28a44fd0cb1751@mail.gmail.com
Whole thread Raw
In response to Re: [COMMITTERS] Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [COMMITTERS] Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after
List pgsql-hackers
On Tue, Feb 23, 2010 at 3:38 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The plan I was thinking of was to pass a flag indicating if it's a
>> directory to fsync_fname() and open it RD_ONLY if it's a directory and
>> RDRW if it's a file. Then ignore any error returns (or at least EBADF
>> and EINVAL) iff the flag indicating it was a directory was true.
>
> Works for me, but let's first try just ignoring EBADF, which is the only
> value we saw in the recent buildfarm failures.  If we got past the fd<0
> test then EBADF could only indicate a rdonly failure, whereas it's less
> clear what EINVAL might cover.

So I'm thinking of something like this.
Ignore ESDIR when opening a directory (and return immediately)
and ignore EBADF when trying to fsync a directory.


--
greg

Attachment

pgsql-hackers by date:

Previous
From: Joachim Wieland
Date:
Subject: Re: Re: Hot Standby query cancellation and Streaming Replication integration
Next
From: Tom Lane
Date:
Subject: Simple fix for contrib/xml2