Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, anjali_524 <anjali_524(at)yahoo(dot)co(dot)in>, Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS
Date: 2012-01-02 20:53:08
Message-ID: 1325537384-sup-6201@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Excerpts from Tom Lane's message of lun ene 02 17:28:33 -0300 2012:

> Anyway the immediate question is which errnos are reasonable for copydir
> to ignore. Just looking at the standard's description of fsync's error
> conditions:
>
> The fsync() function shall fail if:
> [EBADF]
> The fildes argument is not a valid descriptor.
> [EINTR]
> The fsync() function was interrupted by a signal.
> [EINVAL]
> The fildes argument does not refer to a file on which this operation is possible.
> [EIO]
> An I/O error occurred while reading from or writing to the file system.
>
> it seems like EINVAL is a considerably more reasonable thing to return
> than EBADF, if the filesystem is trying to tell you that it won't fsync
> a directory. So I'm a bit surprised this question hasn't come up for
> other filesystems.

Probably because other filesystems do allow you to fsync directories.
In fact for some cases they _require_ it ... remember the fiasco when
MTA writers were told that they needed to fsync their queue dirs in
order for all queued email to persist?

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-01-02 21:00:19 Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS
Previous Message Tom Lane 2012-01-02 20:37:02 Re: BUG #6372: Error while creating database with fsync parameter as on incase of CIFS