{"id":1935,"date":"2010-05-27T13:49:18","date_gmt":"2010-05-27T03:49:18","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=1935"},"modified":"2010-05-27T13:49:18","modified_gmt":"2010-05-27T03:49:18","slug":"a-warning-to-solaris-users-fsync-possibly-doesnt","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2010\/05\/27\/a-warning-to-solaris-users-fsync-possibly-doesnt\/","title":{"rendered":"A warning to Solaris users&#8230;. (fsync possibly doesn&#8217;t)"},"content":{"rendered":"<p>Read the following:<\/p>\n<ul>\n<li><a href=\"http:\/\/blog.lastinfirstout.net\/2010\/04\/oraclesun-zfs-data-loss-still.html\">Oracle\/Sun ZFS Data Loss &#8211; Still Vulnerable<\/a><\/li>\n<li><a href=\"http:\/\/bugs.opensolaris.org\/bugdatabase\/view_bug.do?bug_id=6880764\">OpenSolaris Bug 6880764<\/a><\/li>\n<li><a href=\"http:\/\/blog.lastinfirstout.net\/2010\/04\/bit-by-bug-data-loss-running-oracle-on.html\">Data loss running Oracle on ZFS on Solaris 10, pre 142900-09<\/a><\/li>\n<\/ul>\n<p>Linux has its fair share of dumb things with data too (ext3 not defaulting to using write barriers is a good one). This is however particularly nasty&#8230; I&#8217;d have really hoped there were some good tests in place for this.<\/p>\n<p>This should also be a good warning to anybody implementing advanced storage systems: we database guys really do want to be able to write things reliably and you <strong>really<\/strong> need to make sure this works.<\/p>\n<p>So, Stewart&#8217;s current list of stupid shit you have to do to ensure a 1MB disk write goes to disk in a portable way:<\/p>\n<ul>\n<li>You&#8217;re a database, so you&#8217;re using O_DIRECT<\/li>\n<li>Use &lt; 32k disk writes<\/li>\n<li>fsync()<\/li>\n<li>write 32-64mb of sequential data to hopefully force everything out of the drive write cache and onto the platter to survive power failure (because barriers may not be on). Increase this based on whatever caching system happens to be in place. If you think there may be battery backed RAID&#8230; maybe 1GB or 2GB of data writes<\/li>\n<li>If you&#8217;re extending the file, don&#8217;t bother&#8230; that especially seems to be buggy. Create a new file instead.<\/li>\n<\/ul>\n<p>Of course you could just assume that the OS kind of gets it right&#8230;. *laugh*<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Read the following: Oracle\/Sun ZFS Data Loss &#8211; Still Vulnerable OpenSolaris Bug 6880764 Data loss running Oracle on ZFS on Solaris 10, pre 142900-09 Linux has its fair share of dumb things with data too (ext3 not defaulting to using &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2010\/05\/27\/a-warning-to-solaris-users-fsync-possibly-doesnt\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[311,310,151,46],"class_list":["post-1935","post","type-post","status-publish","format-standard","hentry","category-general","tag-databases","tag-eatmydata","tag-fsync","tag-solaris"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-vd","jetpack-related-posts":[{"id":1587,"url":"https:\/\/www.flamingspork.com\/blog\/2009\/04\/08\/using-dtrace-to-find-out-why-solaris-is-so-slow-and-if-its-actually-solaris\/","url_meta":{"origin":1935,"position":0},"title":"Using Dtrace to find out if the hardware or Solaris is slow (but really just working around the problem)","author":"Stewart Smith","date":"2009-04-08","format":false,"excerpt":"A little while ago, I was the brave soul tasked with making sure Drizzle was working properly and passing all tests on Solaris and OpenSolaris. Brian recently blogged about some of the advantages of also running on Solaris and the SunStudio compilers - more warnings from the compiler is a\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1260,"url":"https:\/\/www.flamingspork.com\/blog\/2008\/11\/21\/scaling-mysql-on-a-256-way-t5440-server-using-solaris-zfs-and-java-17\/","url_meta":{"origin":1935,"position":1},"title":"Scaling MySQL on a 256-way T5440 server using Solaris ZFS and Java 1.7","author":"Stewart Smith","date":"2008-11-21","format":false,"excerpt":"Scaling MySQL on a 256-way T5440 server using Solaris ZFS and Java 1.7 *cough* (and then wipe coffee off the computer) of course the real aim should be to scale with one instance on the machine as scaling with multiple instances on the one machine isn't scaling at all -\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1360,"url":"https:\/\/www.flamingspork.com\/blog\/2012\/05\/28\/zfs-could-have-been-the-future-of-unix-filesystems\/","url_meta":{"origin":1935,"position":2},"title":"ZFS: could have been the future of UNIX Filesystems","author":"Stewart Smith","date":"2012-05-28","format":false,"excerpt":"There was a point a few years ago where Sun could have had the next generation UNIX filesystem. It was in Solaris (and people were excited), there was a port to MacOS X (that was quite exciting for people) and there was a couple of ways to run it on\u2026","rel":"","context":"In &quot;linux-kernel&quot;","block_context":{"text":"linux-kernel","link":"https:\/\/www.flamingspork.com\/blog\/category\/linux-kernel\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1866,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/03\/22\/libeatmydata-for-solaris\/","url_meta":{"origin":1935,"position":3},"title":"libeatmydata for Solaris","author":"Stewart Smith","date":"2010-03-22","format":false,"excerpt":"Thanks to Olly Betts, libeatmydata now has Solaris support as of release-15. So for those of you living on Solaris and actually doing a real fsync() during your test runs... do not fret! Feedback much appreciated (even better in patch form).","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1296,"url":"https:\/\/www.flamingspork.com\/blog\/2008\/12\/11\/opensolaris-200811-first-impressions\/","url_meta":{"origin":1935,"position":4},"title":"OpenSolaris 2008.11 first impressions","author":"Stewart Smith","date":"2008-12-11","format":false,"excerpt":"Using the wonderful bittorrent, I got the CD image in next to no time (in contrast to the Solaris Express image I'm currently downloading via HTTP that's taking forever). Boot time in VirtualBox (off the ISO image) was rather quick, usual questions on keyboard layout and desired language (it'd be\u2026","rel":"","context":"In &quot;sun&quot;","block_context":{"text":"sun","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/sun\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1146,"url":"https:\/\/www.flamingspork.com\/blog\/2008\/07\/16\/adventures-with-opensolaris\/","url_meta":{"origin":1935,"position":5},"title":"Adventures with OpenSolaris","author":"Stewart Smith","date":"2008-07-16","format":false,"excerpt":"So... some colleagues have been experimenting with DTrace a bit, and I've been (for a while now) wanting to experiment with it. The challenge now, instead of in the past, is that I'm setting up a Solaris based system - not getting one premade. I chose OpenSolaris as I'd previously\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.flamingspork.com\/blog\/wp-content\/uploads\/2008\/07\/screenshot-300x198.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/1935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=1935"}],"version-history":[{"count":1,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/1935\/revisions"}],"predecessor-version":[{"id":1936,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/1935\/revisions\/1936"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=1935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=1935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=1935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}