3 ms·
The default in MySQL and in postgresql is to fsync before commit and afaik that has always been the default.
by wolf550e 6y ago
The default in MySQL and in postgresql is to fsync before commit and afaik that has always been the default.
- Thaxll 6y agoNot it was not the case and there was several serious issues with fsync and PG in the past: https://www.percona.com/blog/2019/02/22/postgresql-fsync-failure-fixed-minor-versions-released-feb-14-2019/ https://www.percona.com/blog/2019/02/22/postgresql-fsync-fai... On MySQL: https://dev.mysql.com/doc/refman/8.0/en/innodb-dedicated-server.html https://dev.mysql.com/doc/refman/8.0/en/innodb-dedicated-ser... InnoDB uses O_DIRECT during flushing I/O, but skips the fsync() system call after each write operation. The fsync thing is more complex than it looks like.
- dijit 6y agoThat bug was unfortunate, but you can't say that "it doesn't fsync" because, pedantically, it does, it just ignores the return value. And, obviously that's a bug, it's designed to do so. Also, if you write with O_DIRECT, a fsync is not needed, as it's how you tell the OS to block until written.