News for hackers. Stuff that matters.
Re:PostgreSQL's fsync surprise by cryptonector on Thursday May 03, 2018 @12:46AM (#16983410)
No no no, we need async I/O for files. Writing should not be synchronous, but you should be able to find out about completion of each write.

Asynchrony is absolutely critical for performance.

Filesystem I/O, and, really, disk/SSD I/O is really very much the same as network I/O nowadays. You might be traversing a SAN, for example, or the seek latency on HDD could be reasonable for an HDD but nowadays that's just way too high anyways.

Transactional APIs are very difficult for filesystems. Barriers are enough for many apps. A barrier is also much easier to start using in existing apps. You'd call a system call to request a write barrier, and wait, preferably asynchronously, for completion notice (whereupon you'd know all writes done before the barrier must have reached stable storage).

Re:PostgreSQL's fsync surprise by trentnelson on Thursday May 03, 2018 @06:54PM (#16990759)
So, basically, we need the NT-style, completion-oriented, inherently-asynchronous I/O model? ;-) (Amen!)
Re:PostgreSQL's fsync surprise by davidgould on Thursday May 03, 2018 @08:46PM (#16991314)
You misspelled VMS as NT. And actually VMS borrowed the IO model from RSX-11.

Async QIO style IO is all good clean fun, until someone writes something like:

  fml(...) {
      char buf[1024];
      sys$qio(QIO_READ, buf, sizeof(buf));
      return;
  }
  
  main() {
      fml();
      do_stuff();   //surprise package delivered into stack here!
  }
Re:PostgreSQL's fsync surprise by cryptonector on Friday May 04, 2018 @12:16PM (#16995740)
Yes. Every system call that can block should take an event queue argument. If you want the system call to block then the C library's stub should wait for it for you.