Re: ALTER DATABASE SET TABLESPACE vs crash safety - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ALTER DATABASE SET TABLESPACE vs crash safety
Date
Msg-id 17235.1226075017@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER DATABASE SET TABLESPACE vs crash safety  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: ALTER DATABASE SET TABLESPACE vs crash safety  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Do we need to fsync the directory itself?  My fsync(2) manpage says

>        Calling  fsync()  does  not  necessarily ensure that the entry in the directory
>        containing the file has also reached disk.  For that an explicit fsync()  on  a
>        file descriptor for the directory is also needed.

Hmm ... I see that in the Linux manpage, but not on Darwin, HPUX, or in
the Single Unix Spec.  I'm inclined to argue that we've always expected
the filesystem to take care of its own metadata, and we've never seen
any indication that that's unsafe.  We don't try to "fsync the
directory" after a normal table create for instance.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Martin Pihlak
Date:
Subject: Re: auto_explain contrib moudle
Next
From: Alvaro Herrera
Date:
Subject: Re: ALTER DATABASE SET TABLESPACE vs crash safety