{"id":5387,"date":"2020-07-30T00:11:23","date_gmt":"2020-07-29T16:11:23","guid":{"rendered":"http:\/\/39.97.231.10\/?p=5387"},"modified":"2020-07-30T00:11:23","modified_gmt":"2020-07-29T16:11:23","slug":"mysql-5-78-0-bug-%e7%bb%84%e6%8f%90%e4%ba%a4%e5%8f%82%e6%95%b0%e8%ae%be%e7%bd%ae%e4%b8%8d%e5%bd%93%e5%af%bc%e8%87%b4%e4%ba%8b%e5%8a%a1%e6%8f%90%e4%ba%a4hung%e4%bd%8f","status":"publish","type":"post","link":"http:\/\/www.weijing.co\/?p=5387","title":{"rendered":"MySQL 5.7&amp;8.0 Bug \u7ec4\u63d0\u4ea4\u53c2\u6570\u8bbe\u7f6e\u4e0d\u5f53\u5bfc\u81f4\u4e8b\u52a1\u63d0\u4ea4hung\u4f4f"},"content":{"rendered":"<div>\n<div>\n<div>\nMySQL 5.7\u5f15\u5165\u4e86\u7ec4\u63d0\u4ea4\u529f\u80fd\uff0c\u7ec4\u63d0\u4ea4\u7684\u4e24\u4e2a\u53c2\u6570binlog_group_commit_sync_delay\u548cbinlog_group_commit_sync_no_delay_count\uff0c\u5982\u679c\u8bbe\u7f6e\u4e0d\u5f53\uff0c\u53ef\u80fd\u5bfc\u81f4\u4e8b\u52a1\u63d0\u4ea4hung\u4f4f\u3002\u8fd9\u4e2a\u95ee\u9898\u6301\u7eed\u4e86\u591a\u4e2a\u7248\u672c\uff0c\u4fee\u6539\u4e86\u4e24\u6b21\u6e90\u7801\uff0c\u624d\u6700\u7ec8\u5b8c\u5168\u4fee\u590d\u3002<\/p>\n<h4>\u7b2c\u4e00\u6b21Bug\uff1a<\/h4>\n<p>\u89c1\u5730\u5740\uff1ahttps:\/\/bugs.mysql.com\/bug.php?id=80652<br \/>\n\u6839\u636eBug\u63cf\u8ff0\uff0c\u5f53\u5982\u4e0b\u53c2\u6570\u8bbe\u7f6e\u65f6\uff0c\u4f1a\u89e6\u53d1\u4e8b\u52a1\u63d0\u4ea4hung\u4f4f\u3002<\/p>\n<ul>\n<li>binlog_group_commit_sync_delay\u8bbe\u7f6e\u4e3a1~9<\/li>\n<li>binlog_group_commit_sync_no_delay_count\u8bbe\u7f6e\u4e3a\u5927\u4e8e1<\/li>\n<\/ul>\n<p>\u4ece\u5b98\u65b9\u63d0\u4f9b\u7684Release Note\u6765\u770b\uff0c\u8fd9\u4e2aBug\u57285.7.17\u7248\u672c\u88ab\u4fee\u590d\u3002<br \/>\n\u5bf9\u6bd4\u4e00\u4e0b 5.7.16 \u548c 5.7.17 \u5173\u4e8e\u8fd9\u4e2aBug\u7684\u4fee\u6539\u5185\u5bb9\uff0c\u6e90\u7801\u6587\u4ef6\u4f4d\u4e8e sql\/binlog.cc \u3002<br \/>\n\u9996\u5148\u770b5.7.16\u7684\u8fd9\u6bb5\u4ee3\u7801\uff0c\u5982\u4e0b\uff1a<\/p>\n<pre>time_t Stage_manager::wait_count_or_timeout(ulong count, time_t usec, StageID stage)\n{\n  time_t to_wait=\n    DBUG_EVALUATE_IF(\\\"bgc_set_infinite_delay\\\", LONG_MAX, usec);\n  \/*\n    For testing purposes while waiting for inifinity\n    to arrive, we keep checking the queue size at regular,\n    small intervals. Otherwise, waiting 0.1 * infinite\n    is too long.\n   *\/\n  time_t delta=\n    DBUG_EVALUATE_IF(\\\"bgc_set_infinite_delay\\\", 100000,\n                     static_cast&lt;time_t&gt;(to_wait * 0.1));\n  while (to_wait &gt; 0 &amp;&amp; (count == 0 || static_cast&lt;ulong&gt;(m_queue[stage].get_size()) &lt; count))\n  {\n#ifndef DBUG_OFF\n    if (current_thd)\n      DEBUG_SYNC(current_thd, \\\"bgc_wait_count_or_timeout\\\");\n#endif\n    my_sleep(delta);\n    to_wait -= delta;\n  }\n  return to_wait;\n}\n<\/pre>\n<p>\u51fd\u6570\u4e2d\u7684\u53c2\u6570count\u5c31\u662fbinlog_group_commit_sync_no_delay_count\uff0c\u53c2\u6570usec\u5c31\u662fbinlog_group_commit_sync_delay\uff0c\u5f53usec\u4e3a1~9\u65f6\uff0cdelta \u4e3a0\uff0cto_wait\u4e00\u76f4\u5927\u4e8e0\uff0c\u540c\u65f6count \u5927\u4e8e0\uff0c\u6240\u4ee5\u5728\u5faa\u73af\u4e2d\u957f\u65f6\u95f4\u51fa\u4e0d\u6765\uff0c\u8868\u73b0\u4e3a\u4e8b\u52a1\u63d0\u4ea4\u4e00\u76f4hung\u4f4f\u3002<br \/>\n\u4e0b\u9762\u6765\u770b\u770b5.7.17\u7248\u672c\u5982\u4f55\u4fee\u590d\u7684\uff0c\u770b\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>void Stage_manager::wait_count_or_timeout(ulong count, ulong usec, StageID stage)\n{\n  ulong to_wait=\n    DBUG_EVALUATE_IF(\\\"bgc_set_infinite_delay\\\", LONG_MAX, usec);\n  \/*\n    For testing purposes while waiting for inifinity\n    to arrive, we keep checking the queue size at regular,\n    small intervals. Otherwise, waiting 0.1 * infinite\n    is too long.\n   *\/\n  ulong delta=\n    DBUG_EVALUATE_IF(\\\"bgc_set_infinite_delay\\\", 100000,\n                     max&lt;ulong&gt;(1, (to_wait * 0.1)));\n  while (to_wait &gt; 0 &amp;&amp; (count == 0 || static_cast&lt;ulong&gt;(m_queue[stage].get_size()) &lt; count))\n  {\n#ifndef DBUG_OFF\n    if (current_thd)\n      DEBUG_SYNC(current_thd, \\\"bgc_wait_count_or_timeout\\\");\n#endif\n    my_sleep(delta);\n    to_wait -= delta;\n  }\n}\n<\/pre>\n<p>\u4ece\u4ee3\u7801\u5bf9\u6bd4\u6765\u770b\uff0c\u628a\u6570\u636e\u7c7b\u578b\u00a0time_t\u00a0\u6362\u6210\u4e86\u00a0ulong\uff0c\u4e14delta\u53d6\u503c\u5fc5\u987b\u5927\u4e8e\u7b49\u4e8e1\u3002\u8c8c\u4f3c\u7ed3\u89e3\u4e86\u95ee\u9898\uff0c\u4f46\u662f\u6ca1\u6709\u5f7b\u5e95\u89e3\u51b3\u3002<\/p>\n<h4>\u7b2c\u4e8c\u6b21Bug\uff1a<\/h4>\n<p>\u5206\u6790\u4e0a\u8ff0\u4ee3\u7801\u7684\u903b\u8f91\uff0c\u5982\u679cusec&gt;20\uff0c\u4e14\u4e0d\u662f10\u7684\u6574\u6570\u500d\uff0c\u6bd4\u598221\uff0c\u90a3\u4e48delta\u4e3a2\uff0c\u591a\u6b21\u5faa\u73af\u540e\uff0cto_wait\u4f1a\u53d8\u6210-1\uff0c\u662f\u8d1f\u6570\uff0c\u6211\u4eec\u770bto_wait\u662fulong\u7c7b\u578b\uff0c\u65e0\u7b26\u53f7\u957f\u6574\u5f62\uff0c\u8d8a\u754c\u53d8\u6210\u4e00\u4e2a\u5f88\u5927\u5f88\u5927\u7684\u65e0\u7b26\u53f7\u6574\u6570\uff0cwhile\u5faa\u73af\u65e0\u6cd5\u9000\u51fa\u3002<br \/>\n\u8fd9\u4e2a\u65b0\u7684Bug\u89c1\u94fe\u63a5\uff1a<br \/>\nhttps:\/\/bugs.mysql.com\/bug.php?id=91055<br \/>\n\u6839\u636e\u5b98\u65b9\u6587\u6863\uff0c\u65b0\u7684Bug\u5728 5.7.24 \u548c 8.0.13\u7248\u672c\u5f7b\u5e95\u89e3\u51b3\u3002<br \/>\n\u6211\u4eec\u6765\u770b\u4e0b5.7.24\u7248\u672c\u662f\u5982\u4f55\u5f7b\u5e95\u89e3\u51b3\u7684\uff0c\u5982\u4e0b\uff1a<\/p>\n<pre>void Stage_manager::wait_count_or_timeout(ulong count, long usec, StageID stage)\n{\n long to_wait=\n   DBUG_EVALUATE_IF(\\\"bgc_set_infinite_delay\\\", LONG_MAX, usec);\n \/*\n   For testing purposes while waiting for inifinity\n   to arrive, we keep checking the queue size at regular,\n   small intervals. Otherwise, waiting 0.1 * infinite\n   is too long.\n  *\/\n long delta=\n   DBUG_EVALUATE_IF(\\\"bgc_set_infinite_delay\\\", 100000,\n                    max&lt;long&gt;(1, (to_wait * 0.1)));\n while (to_wait &gt; 0 &amp;&amp; (count == 0 || static_cast&lt;ulong&gt;(m_queue[stage].get_size()) &lt; count))\n {\n#ifndef DBUG_OFF\n   if (current_thd)\n     DEBUG_SYNC(current_thd, \\\"bgc_wait_count_or_timeout\\\");\n#endif\n   my_sleep(delta);\n   to_wait -= delta;\n }\n}\n<\/pre>\n<p>\u4ec5\u4ec5\u4fee\u6539\u4e86\u6570\u636e\u7c7b\u578b\uff0c\u5c06ulong\u6539\u6210\u4e86long\uff0c\u4e5f\u5c31\u4e0d\u5b58\u5728to_wait \u8d1f\u6570\u8d8a\u754c\u7684\u95ee\u9898\u4e86\u3002\n<\/p><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>MySQL 5.7\u5f15\u5165\u4e86\u7ec4\u63d0\u4ea4\u529f\u80fd\uff0c\u7ec4\u63d0\u4ea4\u7684\u4e24\u4e2a\u53c2\u6570binlog_group_commit_sync_dela &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.weijing.co\/?p=5387\"> <span class=\"screen-reader-text\">MySQL 5.7&amp;8.0 Bug \u7ec4\u63d0\u4ea4\u53c2\u6570\u8bbe\u7f6e\u4e0d\u5f53\u5bfc\u81f4\u4e8b\u52a1\u63d0\u4ea4hung\u4f4f<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[90,88],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mailpoet_newsletter_max":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false,"shop_catalog":false,"shop_single":false,"shop_thumbnail":false},"uagb_author_info":{"display_name":"weijing","author_link":"http:\/\/www.weijing.co\/?author=4"},"uagb_comment_info":0,"uagb_excerpt":"MySQL 5.7\u5f15\u5165\u4e86\u7ec4\u63d0\u4ea4\u529f\u80fd\uff0c\u7ec4\u63d0\u4ea4\u7684\u4e24\u4e2a\u53c2\u6570binlog_group_commit_sync_dela&hellip;","_links":{"self":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5387"}],"collection":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5387"}],"version-history":[{"count":0,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5387\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5387"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}