by ausjke · 8y ago · 0 comments
MySQL is under Oracle is one of the major concern, plus it's said to be good for less-write-more-read workload, which is fine.
PostgreSQL is more on the open source side, however bugs like this really concerns me: https://lwn.net/Articles/752063/ -- basically, PostgreSQL does not do its own DIO instead it depends on file system and it can lead to data corruption, and there is no quick fix...
tried to install mysql8.0 on ubuntu16.04 failed so far, need a vm to test it out sometime.
https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.ht...
> Caution: Many operating systems and some disk hardware fool the flush-to-disk operation. They may tell mysqld that the flush has taken place, even though it has not. In this case, the durability of transactions is not guaranteed even with the setting 1, and in the worst case, a power outage can corrupt InnoDB data. Using a battery-backed disk cache in the SCSI disk controller or in the disk itself speeds up file flushes, and makes the operation safer. You can also try to disable the caching of disk writes in hardware caches.
It means that IF and only if, your storage is dying, you might learn about it later than you wish. In cases your storage is dying you are likely also going to observe problems that are outside of an fsync() not reporting an error when you'd like it to. As long as your storage hardware isn't broken, fsync still guarantees durability. Obviously it'd be better to get the error out ASAP.
On the plus side, I think this is great PR for FreeBSD (any filesystem) and ZFS (any OS).
One thing I'm curious about... MySQL still calls fsync() when you use O_DIRECT. See the warnings in the documentation about why O_DIRECT_NO_FSYNC is dangerous (to avoid loss of eg XFS meta-data, otherwise it might forget that a file was truncated or extended). I wonder if in some vanishingly rare failure mode you could lose data that way even with O_DIRECT.
That said, as several people have said, this is a very unlikely failure mode. When filesystems die, you know about it. The type of transient failure required to lose data this way is quite unlikely.
Error handling for a operating system is really complex stuff. I'm surprised that this isn't working properly, fsync is not about speed, but reliability. Userland applications expect it to work and behave as intended.
Without getting overly technical, MySQL's ease of use, wide supported drivers and toolsets, along with it's ubiquitous nature made me choose MySQL.
Also, almost everyone knows MySQL. Easy to find talent.
(Avoiding the technical reasons for brevity).
Also, so many big players use proven MySQL setups (Uber, Github, etc), that I feel like the scalability is there if needed.
EDIT: Does not seem fixed https://dev.mysql.com/doc/refman/8.0/en/temporary-table-prob...