2

As I understand, doublewrite buffering is needed to avoid partial write, because Innodb_page_size default is 16K, while filesystem page size normallly is 4K; I wonder if I set "Innodb_page_size = filesystem page size", then I could disable InnoDB doublewrite buffering safely?

3

Background info... The "torn page" problem occurs when part of an InnoDB block is written to disk, but the physical write died before writing all the low level (usually 512-byte) blocks. This leads to an unreadable block for InnoDB. The double-write buffer, and its extra write, makes it possible to recover from a torn page.

The hardware needs to "guarantee" atomic writes of 16KB. FusionIO is the only drive that I know of to provide that guarantee. And that gives them a advantage by saying that you can turn off double-writes.

RAID controllers with a battery-backed-write-cache should be able to provide such a guarantee, but it is unclear whether the OS confuses the issue. But, then, writes are virtually free, so turning off double-write does not matter much.

I hesitate to say yes or no to your question because I don't know what is underneath the "filesystem". It may turn the InnoDB block into multiple 512-byte disk writes, thereby still allowing torn pages.

O_DIRECT is a related topic to look at.

Setting innodb_page_size to 4K has other issues (even if you could get the drive to play nice) --

  • Records are limited to about 2000 bytes instead of about 8000.
  • You are asking for more I/Os. This may be good or bad. Random point queries of small rows will work faster with 4K blocks; most other situations may work slower.
11
  • Shannon also has SSD products that provide atomic-write – leafonsword Apr 24 '15 at 8:28
  • @leafonsword -- please provide a web page explaining Shannon's solution. – Rick James Apr 24 '15 at 18:08
  • In DTCC 2015, shannon have a presentation introducing their PCIe -- wenku.it168.com/d_001613581.shtml – leafonsword Apr 25 '15 at 11:38
  • I can't read Chinese, but the English titles make it sound like Shannon has addressed not just torn pages, but other I/O needs of InnoDB. Does it do compression, too? – Rick James Apr 25 '15 at 15:00
  • It didn't mention compression feature in this presentation; I think its atomic-write is very exciting because it works on all file system format, while FusionIO needs DFS~ – leafonsword Apr 26 '15 at 2:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.