logoalt Hacker News

thomas_fatoday at 4:19 PM1 replyview on HN

Thanks for pointing it out the mistakes. We should make it clearer, when fsync an opened file descriptor, it would only sync its own metadata. To make it truly persistent, we need to issue another fsync for the directory fd, which would make it more expensive.


Replies

dezgegtoday at 5:02 PM

You don't need to do that for every write though. Only when the database file is created.

show 1 reply