2018-08-21 11:16 GMT+03:00 Gionatan Danti <g.danti@assyoma.it>:
On 20/08/2018 21:40, Reinis Rozitis wrote:
Those atomic write hardware bits the same as ZFS [1] just ensure that any write either lands on the metal (which also tend to lie - write caches on drives/controllers, silent errors, bit rot etc) or not. If the application itself issues a 4KB write when it actually needed to write 8KB.
What puzzles me it that ext4 with data=journal *should* guarantee atomic writes also, but disabling doublewrites led to InnoDB corruption in case of mysqld crash/kill
I believe that the Linux kernel can interrupt any write at 4096-byte boundaries when a signal is delivered to the process. I am curious: Where was it claimed that data=journal guarantees atomic writes (other than [1])? I would expect it to only guarantee that anything that was written to the journal will be durable. Whether the actual write request was honored in full is a separate matter.
It has been covered in some recent Percona blog comments [2] (by some authorities in mysql world)
[2] https://www.percona.com/blog/2017/12/07/hands-look-zfs-with-mysql/#comment-1...
Thanks for the link. The problem I have with such blog is that, in the past, it gave incorrect information on doublewrite safety guarantees [1] Even in the comments section of the link you posted there are users warning against disabling checksum (which is another can of worms, for sure).
Well, it seems I just need to do some in-house testing... :p I'll report back any interesting findings.
[1] https://www.percona.com/blog/2015/06/17/update-on-the-innodb-double-write-bu...
Please report back any findings, whether or not you consider them to be interesting. I believe that it is technically possible for a copy-on-write filesystem like ZFS to support atomic writes, but for that to be possible in practice, the interfaces inside the kernel must be implemented in an appropriate way. Disclaimer: I have no knowledge of the implementation details of any kernel. -- Marko Mäkelä, Lead Developer InnoDB MariaDB Corporation