Andres Freund <and...@anarazel.de> wrote:

> I started setting up some halfway automated method of simulating hard crashes 
> and even while setting those up I found some pretty unsettling results...
> Now its not unlikely that my testing is flawed but unfortunately I don't see 
> where right now (its 3am now and I have a 8h trainride behind me, so ...)

I think the reported behavior is a TODO item to research:

 * Research use of fsync to a newly created directory.
   There is no guarantee that mkdir() flushes metadata of the directory.

Also, I heard ext4 has a "feature" in that rename() might truncate the
renamed file to zero bytes on crash. The user data in the file might be
lost if the machine crashes just after rename().

 * Research whether our use of rename() is safe on various file systems.
   Especially on ext4, the contents of the renamed file might be lost on crash.

Comments and suggestion for improvements of words welcome.
If no objection, I'll add them at the Fsync section in the TODO page.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to