{"id":148,"date":"2020-06-09T14:32:16","date_gmt":"2020-06-09T06:32:16","guid":{"rendered":"http:\/\/www.gbase8.cn\/?p=148"},"modified":"2024-12-23T17:37:39","modified_gmt":"2024-12-23T09:37:39","slug":"gbase-8a%e9%9b%86%e7%be%a4%e6%9f%a5%e7%9c%8bgnode%e8%ae%a1%e7%ae%97%e8%8a%82%e7%82%b9%e6%9f%90%e5%bc%a0%e8%a1%a8%e7%9a%84%e9%94%81","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/148","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u96c6\u7fa4\u67e5\u770bgnode\u8ba1\u7b97\u8282\u70b9\u67d0\u5f20\u8868\u7684\u9501"},"content":{"rendered":"<p>GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u901a\u8fc7\u9501\u673a\u5236\u5b9e\u73b0\u5e76\u884c\u8bbf\u95ee\u63a7\u5236\uff0c\u5728\u96c6\u7fa4\u7ba1\u7406\u5c42\u548c\u6570\u636e\u8ba1\u7b97\u5c42\u90fd\u6709\u5404\u81ea\u7684\u9501\uff0c\u672c\u6587\u4ecb\u7ecd\u5728\u8ba1\u7b97\u8282\u70b9\u67e5\u770b\u9501\u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2aa0e9208ef\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2aa0e9208ef\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/148\/#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95\" >\u4f7f\u7528\u65b9\u6cd5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/148\/#%E4%BD%BF%E7%94%A8%E6%A0%B7%E4%BE%8B1\" >\u4f7f\u7528\u6837\u4f8b1<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/148\/#%E4%BD%BF%E7%94%A8%E6%A0%B7%E4%BE%8B2\" >\u4f7f\u7528\u6837\u4f8b2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/148\/#%E6%8B%BF%E5%88%B0%E9%94%81%E5%AF%B9%E5%BA%94%E7%9A%84session\" >\u62ff\u5230\u9501\u5bf9\u5e94\u7684session<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/148\/#953%E6%96%B0%E7%89%88%E6%9C%AC%E6%9F%A5%E7%9C%8Block%E5%AF%B9%E5%BA%94session\" >953\u65b0\u7248\u672c\u67e5\u770block\u5bf9\u5e94session<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/148\/#%E5%8F%82%E8%80%83\" >\u53c2\u8003<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95\"><\/span>\u4f7f\u7528\u65b9\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>show table locks \u5e93\u540d.\u8868\u540d<\/p>\n\n\n\n<p>\u6bd4\u5982show table locks testdb.t_n1\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8%E6%A0%B7%E4%BE%8B1\"><\/span>\u4f7f\u7528\u6837\u4f8b1<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1028\" height=\"221\" src=\"http:\/\/www.gbase8.cn\/wp-content\/uploads\/2020\/06\/image-48.png\" alt=\"\" class=\"wp-image-151\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8%E6%A0%B7%E4%BE%8B2\"><\/span>\u4f7f\u7528\u6837\u4f8b2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase&gt; show table locks t1;\nEmpty set (Elapsed: 00:00:00.00)\n\ngbase&gt; lock table t1 write;\\\nERROR 1235 (42000): This version of GBase doesn't yet support 'lock Table when use transaction mode'\ngbase&gt; set autocommit=0;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.00)\n\ngbase&gt; select * from t1;\n+------+-----------+\n| id   | name      |\n+------+-----------+\n|    1 | First     |\n|    2 | \u7b2c\u4e8c\u540d    |\n+------+-----------+\n2 rows in set (Elapsed: 00:00:00.00)\n\ngbase&gt; insert into t1 values(3,'333');\nQuery OK, 1 row affected (Elapsed: 00:00:00.00)\n\ngbase&gt; show table locks t1;\n+--------+-----------+-----------+------------+-------------------+---------------+--------------------+\n| DB     | TableName | ReadLocks | WriteLocks | ReceiveWriteLocks | ExcusiveLocks | ExcusiveWriteLocks |\n+--------+-----------+-----------+------------+-------------------+---------------+--------------------+\n| testdb | t1        |         1 |          1 |                 0 |             0 |                  0 |\n+--------+-----------+-----------+------------+-------------------+---------------+--------------------+\n1 row in set (Elapsed: 00:00:00.00)\n\n<\/code><\/pre>\n\n\n\n<p>\u5176\u4e2d<br>ReadLocks \u8bfb\u9501<br>WriteLocks \u5199\u9501<br>ReceiveWriteLocks \u62ff\u5230\u7684\u5199\u9501<br>ExcusiveLocks \u6392\u4ed6\u9501\uff0c\u72ec\u5360\u9501<br>ExcusiveWriteLocks \u6392\u5b83\u5199\u9501<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%8B%BF%E5%88%B0%E9%94%81%E5%AF%B9%E5%BA%94%E7%9A%84session\"><\/span>\u62ff\u5230\u9501\u5bf9\u5e94\u7684session<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u901a\u8fc7gbaseadmin \u7684debug\u547d\u4ee4\uff0c\u83b7\u5f97\u9501\u7684\u8be6\u60c5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbaseadmin -h10.0.2.201  -P5050 debug<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u4ecesystem.log\u91cc\u9762\u770b\u5230\u8f93\u51fa\u3002\u8bf7\u5173\u6ce8\u6700\u540e\u7684\u603b\u7ed3\u90e8\u5206\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>Memory status:\nNon-mmapped space allocated from system: 658505728\nNumber of free chunks:                   0\nNumber of fastbin blocks:                0\nNumber of mmapped regions:               0\nSpace in mmapped regions:                0\nMaximum total allocated space:           0\nSpace available in freed fastbin blocks: 471488312\nTotal allocated space:                   181741768\nTotal free space:                        5275648\nTop-most, releasable space:              0\nEstimated memory (with thread stack):    661127168\n\n\n\nEvents status:\nLLA = Last Locked At  LUA = Last Unlocked At\nWOC = Waiting On Condition  DL = Data Locked\n\nEvent scheduler status:\nState      : INITIALIZED\nThread id  : 0\nLLA        : n\/a:0\nLUA        : n\/a:0\nWOC        : NO\nWorkers    : 0\nExecuted   : 0\nData locked: NO\n\nEvent queue status:\nElement count   : 0\nData locked     : NO\nAttempting lock : NO\nLLA             : init_queue:132\nLUA             : init_queue:142\nWOC             : NO\nNext activation : never\n\nStatus information:\n\nCurrent dir: \/opt\/gnode\/userdata\/gbase\/\nRunning threads: 10  Stack size: 262144\nCurrent locks:\nlock: 0x1104c410:\n\nlock: 0x1020e5b0:\n\nlock: 0x7eaa310: write\nwrite     : 0x1c9f1170 (127151:6);\n\nlock: 0x3ebfb68:\n\nlock: 0x3ed6368:\n\nlock: 0x3e1fb68:\n\nlock: 0x3c68b68:\n\nlock: 0x3c6d968:\n\nlock: 0x3b6e168:\n\nlock: 0x3c6ac68:\n\nlock: 0x3b6d768:\n\nlock: 0x3c2de68:\n\nlock: 0x3c2cc68:\n\nlock: 0x3c1cf68:\n\nlock: 0x45df368:\n\nlock: 0x3b51968:\n\nlock: 0x4e69368:\n\nlock: 0x3c01568:\n\nlock: 0x3b50e68:\n\nlock: 0x3b4b968:\n\nlock: 0x4e66b68:\n\n\nKey caches:\ndefault\nBuffer_size:       8384512\nBlock_size:           1024\nDivision_limit:        100\nAge_limit:             300\nblocks used:             4\nnot flushed:             0\nw_requests:              0\nwrites:                  0\nr_requests:             30\nreads:                   4\n\n\nhandler status:\nread_key:           14\nread_next:           0\nread_rnd             0\nread_first:          3\nwrite:             306\ndelete               0\nupdate:              0\n\nTable status:\nOpened tables:     131521\nOpen tables:           24\nOpen files:            36\nOpen streams:           0\n\nAlarm status:\nActive alarms:   0\nMax used alarms: 7\nNext alarm time: 0\n\nThread database.table_name          Locked\/Waiting        Lock_type\n\n127151  testdb.t1_n1                Locked - write        High priority write lock\n\n\n\n\nBegin safemalloc memory dump:\n\nEnd safemalloc memory dump.\n<\/code><\/pre>\n\n\n\n<p>\u5982\u4e0a\u603b\u7ed3\u90e8\u5206\u5982\u4e0b\u3002 \u7ebf\u7a0bsessionID, \u5e93\u8868\uff0c\u9501\uff0c\u9501\u7c7b\u578b\u3002 <\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>Thread database.table_name          Locked\/Waiting        Lock_type\n\n127151  testdb.t1_n1                Locked - write        High priority write lock\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"953%E6%96%B0%E7%89%88%E6%9C%AC%E6%9F%A5%E7%9C%8Block%E5%AF%B9%E5%BA%94session\"><\/span>953\u65b0\u7248\u672c\u67e5\u770block\u5bf9\u5e94session<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5728953\u65b0\u7248\u672c\u91cc\uff0c\u4f1a\u989d\u5916\u8f93\u51fasession\u5217\uff0c\u91cc\u9762\u5305\u542b\u4e86\u5f53\u524d\u62ff\u5230\u9501\u7684sessoin ID\u3002<\/p>\n\n\n\n<p>\u5982\u4e0b\u7684\u4f8b\u5b50\u4e2d\uff0c\u9501\u5728ID=82\u7684session\uff0c \u5982\u679c\u51fa\u73b0\u5361\u4f4f\u7b49\uff0c\u53ef\u4ee5kill\u638982\u6765\u91ca\u653e\u9501\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase> show table locks aa_n1;\r\n+--------+-----------+------------+------------+--------+--------+-----------+-------+---------+-----------+\r\n| DB     | TableName | InsertFlag | CommitFlag | RDLCKs | WRLCKs | RecWRLCKs | ExLCK | ExWRLCK | Session   |\r\n+--------+-----------+------------+------------+--------+--------+-----------+-------+---------+-----------+\r\n| testdb | aa_n1     |          0 |          0 |      0 |      0 |         0 |     1 |       0 | 82(6048)  |\r\n+--------+-----------+------------+------------+--------+--------+-----------+-------+---------+-----------+\r\n1 row in set (Elapsed: 00:00:00.00)\r\n\r\ngbase> show processlist;\r\n+----+-------+------------------+--------+---------+------+-------+------------------+\r\n| Id | User  | Host             | db     | Command | Time | State | Info             |\r\n+----+-------+------------------+--------+---------+------+-------+------------------+\r\n|  1 | gbase | 10.0.2.103:59223 | NULL   | Sleep   |   39 | NULL  | NULL             |\r\n| 77 | root  | localhost        | testdb | Query   |    0 | NULL  | show processlist |\r\n| 82 | root  | localhost        | testdb | Sleep   |   15 | NULL  | NULL             |\r\n+----+-------+------------------+--------+---------+------+-------+------------------+\r\n3 rows in set (Elapsed: 00:00:00.00)\r\n\r\ngbase>\r\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83\"><\/span>\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-\u8001\u7d2b\u7af9\u7684\u5bb6 wp-block-embed-\u8001\u7d2b\u7af9\u7684\u5bb6\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"j8Ob9D0VQ6\"><a href=\"https:\/\/www.gbase8.cn\/en\/24\/\">\u5357\u5927\u901a\u7528GBase8a MPP Cluster\u67e5\u770b\u96c6\u7fa4\u9501 showlock<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u300a\u5357\u5927\u901a\u7528GBase8a MPP Cluster\u67e5\u770b\u96c6\u7fa4\u9501 showlock\u300b\u2014\u8001\u7d2b\u7af9\u7684\u5bb6\" src=\"https:\/\/www.gbase8.cn\/24\/embed#?secret=j8Ob9D0VQ6\" data-secret=\"j8Ob9D0VQ6\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>","protected":false},"excerpt":{"rendered":"<p>\u5357\u5927\u901a\u7528GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u901a\u8fc7\u9501\u673a\u5236\u5b9e\u73b0\u5e76\u884c\u8bbf\u95ee\u63a7\u5236\uff0c\u5728\u96c6\u7fa4\u7ba1\u7406\u5c42\u548c\u6570\u636e\u8ba1\u7b97\u5c42\u90fd\u6709\u5404\u81ea\u7684\u9501\uff0c\u672c\u6587\u4ecb\u7ecd\u5728\u8ba1\u7b97\u8282\u70b9\u67e5\u770b\u9501\u7684\u65b9\u6cd5\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[3],"tags":[51],"class_list":["post-148","post","type-post","status-publish","format-aside","hentry","category-gbase8a","tag-51","post_format-post-format-aside"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":7,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/148\/revisions"}],"predecessor-version":[{"id":12957,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/148\/revisions\/12957"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}