News for hackers. Stuff that matters.
Re:PostgreSQL used fsync incorrectly for 20 years by brianberns on Sunday February 10, 2019 @10:40AM (#19128171)
If “write” expects you to always call it in a loop, I wonder why it wasn’t simply implemented so that it calls itself in a loop in the first place. Or at least provide a “writeAll” wrapper function.
Re:PostgreSQL used fsync incorrectly for 20 years by lemoncucumber on Sunday February 10, 2019 @11:46AM (#19128492)
What if the disk is literally unplugged after a partial write? (or the network cable unplugged, etc.)

Callers would still need to be informed that a partial write occurred and would need to do something about it.

Re:PostgreSQL used fsync incorrectly for 20 years by adrianratnapala on Sunday February 10, 2019 @11:04PM (#19131978)
When I call write(), it is typically already inside a bigger loop. If the system can't write my whole buffer right now, then I am happy to get the CPU back so I can do more work before trying again (and now I might have more data for it too).
Re:PostgreSQL used fsync incorrectly for 20 years by DannyBee on Sunday February 10, 2019 @12:17PM (#19128704)
This is literally the case study from worse is better :) https://www.jwz.org/doc/worse-is-better.html