Can InnoDB do without doublewrite

Can InnoDB do without doublewrite

am 17.08.2010 19:22:21 von Neutron

Hi all,

I don't fully understand the importance of doublewrite in InnoDB.

(1) Performance wise.
Performance wise I can understand that, doublewrite can coalesce many
dirty pages into a big buf chunk, and upon flush, first write this big
buf chunk to tablespace + fsync(), then write those individual dirty
pages followed by a single fsync(). So that we can reduce number of
fsync() calls.

This makes perfect sense for a hard disk. But if I use a high-end SSD
with O_DIRECT ( so that, random write performance is similar to
sequential write ), and given the simulated aio used by InnoDB, we
cannot get much benefits of the extra coalesced big write.

(2) For data integrity.
I understand that, doublewrite can guarantee we always have an full
valid page (even though it might be dated ) in case of crashes, power
failures, etc.

But even if we have a corrupted page (without doublewrite), we should
still be able to recover thanks to the log.
Like every DB, InnoDB logs every update to a log file before the
changes are applied to data pages, and the logs are flushed to stable
disk at commit before the changed data pages are stored to stable
disk. So upon a failure we can always replay the log to restore
partial pages.

I haven't grasped full knowledge of doublewrite and InnoDB yet. Is
there anything wrong with my above comments? Why do we need the
extra doublewrite?



-Neutron

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org