{"id":708,"date":"2008-01-29T00:25:37","date_gmt":"2008-01-29T05:25:37","guid":{"rendered":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/29\/trying-to-reliably-make-myisam-crash-maria-is-sturdy-as"},"modified":"2008-01-30T20:10:00","modified_gmt":"2008-01-31T01:10:00","slug":"trying-to-reliably-make-myisam-crash-maria-is-sturdy-as","status":"publish","type":"post","link":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/29\/trying-to-reliably-make-myisam-crash-maria-is-sturdy-as","title":{"rendered":"Trying to reliably make MyISAM crash; Maria is sturdy as"},"content":{"rendered":"<p>I&#8217;ve been very excited seeing that we announced the <a href=\"http:\/\/forge.mysql.com\/wiki\/Maria_Preview\">Maria Engine Preview<\/a>. <a href=\"http:\/\/datacharmer.blogspot.com\/2008\/01\/introducing-maria-new-tough-storage.html\">Giuseppe<\/a> and I were trying to setup a demo, for Maria, at the lightning talks happening later today, towards the end of the MySQL MiniConf at linux.conf.au 2008. It involved MySQL with Maria, and an Asus Eee PC. For the demo, we wanted to show pulling the plug, which can be done either via a <tt>kill -9 `pgrep mysqld`<\/tt> or pulling out the battery of the Eee.<\/p>\n<p>However, we failed to get MyISAM to reliably crash! Yes, imagine that, we actually want it to crash &#8211; pity that it might have only happened about 1\/3rd of the time we tested it. The magic we were looking for:<\/p>\n<pre>\r\ncheck table t1;\r\n+---------+-------+----------+---------------------------------------------------------+\r\n| Table   | Op    | Msg_type | Msg_text                                                |\r\n+---------+-------+----------+---------------------------------------------------------+\r\n| test.t1 | check | warning  | 1 client is using or hasn't closed the table properly   |\r\n| test.t1 | check | warning  | Size of datafile is: 23998464       Should be: 16000256 |\r\n| test.t1 | check | error    | Recordlink that points outside datafile at 23000368     |\r\n| test.t1 | check | error    | Corrupt                                                 |\r\n+---------+-------+----------+---------------------------------------------------------+\r\n4 rows in set (0.09 sec)<\/pre>\n<p>What we got instead was just a warning mentioning a client is using or hasn&#8217;t closed the table properly. Clearly, not so good for a demonstration.<\/p>\n<p>When the magic of <tt>set storage_engine=maria;<\/tt> was run, and you crashed (either via pulling out the battery or doing a kill operation), Maria would survive the crash. At worst, you&#8217;ll see:<\/p>\n<pre>\r\ncheck table t1;\r\n+---------+-------+----------+------------------------------------------------------------+\r\n| Table   | Op    | Msg_type | Msg_text                                                   |\r\n+---------+-------+----------+------------------------------------------------------------+\r\n| test.t1 | check | warning  | Auto-increment value: 0 is smaller than max used value: 32 |\r\n| test.t1 | check | status   | OK                                                         |\r\n+---------+-------+----------+------------------------------------------------------------+\r\n2 rows in set (0.20 sec)<\/pre>\n<p>So, Maria is clearly <em>tough<\/em>, as Giuseppe puts it. Give it a twirl (<a href=\"ftp:\/\/ftp.mysql.com\/pub\/mysql\/download\/maria\/\">binaries<\/a>, <a href=\"http:\/\/mysql.bkbits.net:8080\/mysql-maria\/\">sources<\/a>), and hop on over to the <a href=\"http:\/\/forums.mysql.com\/list.php?157\">Maria Forums<\/a> if you have questions. And if you&#8217;re checking out\/building from source, you might find the <a href=\"http:\/\/www.bytebot.net\/blog\/archives\/2007\/10\/11\/building-mysql-from-source\">Building MySQL from source<\/a> guide handy<\/p>\n<p>Alas, only a demo in a VM today . It seems more reliable inside a VM, not quite on the Eee. Besides, the poor SSD has been through quite a number of fsck&#8217;s now. BTW, one other thing to note: Maria log files seem to be pretty huge. Running it on a SSD that has about 1.5GB of free space (total, 4GB), is harsh.<\/p>\n<p>For reference, the test (generally, wait for count to reach 128, switch terminals, and kill mysqld\/pop battery off):<\/p>\n<pre>drop table if exists t1;\r\n\r\ncreate table t1 (id int not null auto_increment primary key, b longblob) ;\r\nselect table_schema,table_name,engine\r\n     from information_schema.tables\r\n     where table_schema=schema() and table_name='t1';\r\ninsert into t1 values (1, repeat('a',1000000));\r\ninsert into t1 select null,b from t1; select count(*) from t1;\r\ninsert into t1 select null,b from t1; select count(*) from t1;\r\ninsert into t1 select null,b from t1; select count(*) from t1;\r\ninsert into t1 select null,b from t1; select count(*) from t1;\r\ninsert into t1 select null,b from t1; select count(*) from t1;\r\ninsert into t1 select null,b from t1; select count(*) from t1;\r\ninsert into t1 select null,b from t1; select count(*) from t1;\r\ninsert into t1 select null,b from t1; select count(*) from t1;\r\ninsert into t1 select null,b from t1; select count(*) from t1;<\/pre>\n<p>Technorati Tags: <a href=\"http:\/\/technorati.com\/tag\/mysql\" class=\"performancingtags\" rel=\"tag\">mysql<\/a>, <a href=\"http:\/\/technorati.com\/tag\/maria\" class=\"performancingtags\" rel=\"tag\">maria<\/a>, <a href=\"http:\/\/technorati.com\/tag\/myisam\" class=\"performancingtags\" rel=\"tag\">myisam<\/a>, <a href=\"http:\/\/technorati.com\/tag\/demo\" class=\"performancingtags\" rel=\"tag\">demo<\/a>, <a href=\"http:\/\/technorati.com\/tag\/storage%20engine\" class=\"performancingtags\" rel=\"tag\">storage engine<\/a><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20Trying%20to%20reliably%20make%20MyISAM%20crash%3B%20Maria%20is%20sturdy%20as&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2008%2F01%2F29%2Ftrying-to-reliably-make-myisam-crash-maria-is-sturdy-as&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"9c5e56b128\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/29\/trying-to-reliably-make-myisam-crash-maria-is-sturdy-as?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-708\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/29\/trying-to-reliably-make-myisam-crash-maria-is-sturdy-as?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-708\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/29\/trying-to-reliably-make-myisam-crash-maria-is-sturdy-as?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-708\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/29\/trying-to-reliably-make-myisam-crash-maria-is-sturdy-as?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been very excited seeing that we announced the Maria Engine Preview. Giuseppe and I were trying to setup a demo, for Maria, at the lightning talks happening later today, towards the end of the MySQL MiniConf at linux.conf.au 2008. It involved MySQL with Maria, and an Asus Eee PC. For the demo, we wanted [&hellip;]<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button share-icon\" href=\"mailto:?subject=%5BShared%20Post%5D%20Trying%20to%20reliably%20make%20MyISAM%20crash%3B%20Maria%20is%20sturdy%20as&body=http%3A%2F%2Fwww.bytebot.net%2Fblog%2Farchives%2F2008%2F01%2F29%2Ftrying-to-reliably-make-myisam-crash-maria-is-sturdy-as&share=email\" target=\"_blank\" title=\"Click to email a link to a friend\" data-email-share-error-title=\"Do you have email set up?\" data-email-share-error-text=\"If you&#039;re having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself.\" data-email-share-nonce=\"9c5e56b128\" data-email-share-track-url=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/29\/trying-to-reliably-make-myisam-crash-maria-is-sturdy-as?share=email\"><span>Email<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-708\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/29\/trying-to-reliably-make-myisam-crash-maria-is-sturdy-as?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\" ><span>Facebook<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-708\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/29\/trying-to-reliably-make-myisam-crash-maria-is-sturdy-as?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\" ><span>LinkedIn<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-708\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/29\/trying-to-reliably-make-myisam-crash-maria-is-sturdy-as?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\" ><span>Twitter<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_options":[]},"categories":[23],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4vJD-bq","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":706,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/01\/28\/morning-sessions-at-mysql-miniconf","url_meta":{"origin":708,"position":0},"title":"Morning sessions at MySQL MiniConf","date":"28\/1\/2008","format":false,"excerpt":"Upcoming MySQL Features - Stewart SmithStewart's talk on Upcoming MySQL Features was sort of a roadmap of what one might expect to see in MySQL 5.1 and above - he touched on Falcon, online backup, batched key access, Maria, Proxy, Workbench, and some cluster changes. When he shares his slides,\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":562,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2007\/06\/05\/ticketmaster-thrives-on-mysql-replication","url_meta":{"origin":708,"position":1},"title":"Ticketmaster thrives on MySQL Replication","date":"5\/6\/2007","format":false,"excerpt":"Even though the conference is long over, I still have unpublished notes sitting on my ~\/Desktop, and it only makes sense that I clean it out. These are notes from Ed Presz's session, titled For Ticketmaster, MySQL Replication is the Ticket! They are as always, pretty raw.We were all given\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":791,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/04\/15\/mysql-full-text-search-by-alex-rubin","url_meta":{"origin":708,"position":2},"title":"MySQL Full Text Search by Alex Rubin","date":"15\/4\/2008","format":false,"excerpt":"Download the PDF: http:\/\/www.mysqlfulltextsearch.com\/full_text.pdfDefault search by relevance, default sort is by relevanceBoolean search is also popular. cats AND dogs. No default sorting, so you need to order the results yourselfPhrase searchMySQL Full Text Index, only available with MyISAM, and it supports natural language and Boolean search. ft_min_word_len - 4 characters\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2259,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2012\/02\/05\/how-to-offload-mysql-server-with-sphinx-by-vladimir-fedorkov","url_meta":{"origin":708,"position":3},"title":"How to offload MySQL server with Sphinx by Vladimir Fedorkov","date":"5\/2\/2012","format":false,"excerpt":"Vladimir Fedorkov of Sphinx. Presentation started out with a very nice presentation of candies to all the audience members. What is Sphinx? Another (C++) daemon on your boxes. Can be queried via API (PHP, Python, etc.) or MySQL-compatible protocol and SQL queries (SphinxQL). Some query examples are in the slides,\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2832,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2013\/11\/30\/groonga-fulltext-search-library-for-cloud-web","url_meta":{"origin":708,"position":4},"title":"groonga &#8211; fulltext search library for cloud &#038; web","date":"30\/11\/2013","format":false,"excerpt":"This is an incomplete fragment from 2011. Figure its worth publishing this now, considering MariaDB is likely to get groonga in the near future. The groonga team have released MariaDB 10.0.6 binaries as well. This is all part of the mroonga\u00a0project. These were my quick notes from the groonga talk\u2026","rel":"","context":"In &quot;MariaDB&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":788,"url":"http:\/\/www.bytebot.net\/blog\/archives\/2008\/04\/15\/keynote-with-marten-mickos-at-mysql-conference-2008","url_meta":{"origin":708,"position":5},"title":"Keynote with Marten Mickos at MySQL Conference 2008","date":"15\/4\/2008","format":false,"excerpt":"Live blogging from Marten Mickos' (SVP Database Group) keynote at the MySQL Conference and Expo 2008.Why did Sun acquire us?The culture and the vision. Biggest match with Sun. \"Network is the computer\" and \"Best Online Database\". Great affinity.Its a 1 billion dollar vote for the LAMP stack.Integrating better with OpenOffice.org,\u2026","rel":"","context":"In &quot;MySQL&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"amp_enabled":true,"_links":{"self":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/708"}],"collection":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/comments?post=708"}],"version-history":[{"count":0,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/posts\/708\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/media?parent=708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/categories?post=708"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.bytebot.net\/blog\/wp-json\/wp\/v2\/tags?post=708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}