News for hackers. Stuff that matters.
Re:OS X LevelDB Corruption Bounty: 10.00 BTC + 200.2 LTC by antirez on Monday November 25, 2013 @05:45AM (#6793397)
In other words, what the osx default fsync() semantics is useful for? I had the same discussion on Twitter a few days ago...
Re:OS X LevelDB Corruption Bounty: 10.00 BTC + 200.2 LTC by Someone on Monday November 25, 2013 @12:26PM (#6795400)
It is useful for forcing all writes out to the storage device. If you device is battery/UPS backed, has enough capacity to flush its buffers (to disk or to flash memory) after a power loss, that is sufficient to (eventually) get your data on disk (yes,the drive may fail, but if that happens after the data has hit the platter, you have no guarantees, either)

From what I understand, that behaviour is in spec (for me, borderline, at best, but I don't make that spec) according to http://pubs.opengroup.org/onlinepubs/009695399/functions/fsy... ("physical write from the buffer cache", not "physical write to the disk") and, AFAIK, is what others do, too (http://ridiculousfish.com/blog/posts/mystery.html)

Edit: http://lists.apple.com/archives/darwin-dev/2005/Feb/msg00072..., referenced from that ridiculous fish post, gives more background info.

Re:OS X LevelDB Corruption Bounty: 10.00 BTC + 200.2 LTC by antirez on Monday November 25, 2013 @01:43PM (#6795975)
Ok makes sense in special cases indeed, however a really unsafe default...