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

From Alvaro Herrera
Subject Re: ALTER DATABASE SET TABLESPACE vs crash safety
Date
Msg-id 20081107155949.GC5507@alvh.no-ip.org
Whole thread Raw
In response to ALTER DATABASE SET TABLESPACE vs crash safety  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ALTER DATABASE SET TABLESPACE vs crash safety  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

> That is, that's true as long as the filesystem copy in fact pushed
> everything to disk.  copydir() does an fsync() on each file it copies,
> so I think we have done as much as we can to protect the data being
> copied, but I wonder if anyone feels it's too dangerous?

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
reacheddisk.  For that an explicit fsync()  on  a      file descriptor for the directory is also needed.
 


-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

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