描述

    • kill proxysession (cs_id | connection_id)语句

    • kill掉指定cs, 与kill connection id一致。

    • id既可以是cs id,也可以是connection id, 展示结果相同。

    • cs id为proxy内部标记每个client的id号, connection id为整个OceanBase数据库标记每个client的id号。

    • kill proxysession (cs_id | connection_id) ss_id语句

    • kill掉指定cs上得server session,该ss_id可以从show proxysession attribute id中获取。

    • id既可以是cs id,也可以是connection id, 展示结果相同。

    • cs id为proxy内部标记每个client的id号, connection id为整个OceanBase数据库标记每个client的id号。

    示例

    1. mysql> show proxysession;
    2. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    3. | proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
    4. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    5. | 756006681247547400 | 7 | ob1.jianhua.sjh | sys | root | 127.0.0.1:23706 | NULL | 0 | 1 | MCS_ACTIVE_READER | 2230520 | 2230520 |
    6. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    7. 1 row in set (0.00 sec)
    8. mysql> kill proxysession 7;
    9. ERROR 1317 (70100): Query execution was interrupted
    10. mysql> show proxysession;
    11. ERROR 2006 (HY000): MySQL server has gone away
    12. No connection. Trying to reconnect...
    13. Connection id: 8
    14. Current database: *** NONE ***
    15. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    16. | proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
    17. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    18. | 756006681247547401 | 8 | ob1.jianhua.sjh | sys | root | 127.0.0.1:23715 | NULL | 0 | 1 | MCS_ACTIVE_READER | 2230520 | 2230520 |
    19. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    20. 1 row in set (0.01 sec)
    21. mysql> select connection_id();
    22. +-----------------+
    23. | connection_id() |
    24. +-----------------+
    25. | 2147549203 |
    26. +-----------------+
    27. 1 row in set (0.00 sec)
    28. mysql> kill proxysession 2147549203;
    29. ERROR 1317 (70100): Query execution was interrupted
    30. mysql> show proxysession;
    31. ERROR 2006 (HY000): MySQL server has gone away
    32. No connection. Trying to reconnect...
    33. Connection id: 9
    34. Current database: *** NONE ***
    35. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    36. | proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
    37. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    38. | 756006681247547402 | 9 | ob1.jianhua.sjh | sys | root | 127.0.0.1:23734 | NULL | 0 | 1 | MCS_ACTIVE_READER | 2230520 | 2230520 |
    39. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    40. 1 row in set (0.01 sec)
    1. mysql> show proxysession attribute;
    2. +------------------------+---------------------+----------------+
    3. | attribute_name | value | info |
    4. +------------------------+---------------------+----------------+
    5. | proxy_sessid | 756006681247547402 | cs common |
    6. | cs_id | 9 | cs common |
    7. | cluster | ob1.jianhua.sjh | cs common |
    8. | tenant | sys | cs common |
    9. | user | root | cs common |
    10. | host_ip | 127.0.0.1 | cs common |
    11. | host_port | 23734 | cs common |
    12. | db | NULL | cs common |
    13. | total_trans_cnt | 0 | cs common |
    14. | svr_session_cnt | 1 | cs common |
    15. | active | true | cs common |
    16. | read_state | MCS_ACTIVE_READER | cs common |
    17. | tid | 2230520 | cs common |
    18. | pid | 2230520 | cs common |
    19. | modified_time | 1469436154736537702 | cs stat |
    20. | reported_time | 1469436154734045058 | cs stat |
    21. | hot_sys_var_version | 0 | cs var version |
    22. | sys_var_version | 0 | cs var version |
    23. | user_var_version | 0 | cs var version |
    24. | last_insert_id_version | 0 | cs var version |
    25. | db_name_version | 0 | cs var version |
    26. | server_ip | 10.244.4.28 | last used ss |
    27. | server_port | 13203 | last used ss |
    28. | server_sessid | 2147549204 | last used ss |
    29. | ss_id | 10 | last used ss |
    30. | state | MSS_KA_CLIENT_SLAVE | last used ss |
    31. | transact_count | 1 | last used ss |
    32. | server_trans_stat | 0 | last used ss |
    33. | hot_sys_var_version | 0 | last used ss |
    34. | sys_var_version | 0 | last used ss |
    35. | user_var_version | 0 | last used ss |
    36. | last_insert_id_version | 0 | last used ss |
    37. | db_name_version | 0 | last used ss |
    38. +------------------------+---------------------+----------------+
    39. 33 rows in set (0.00 sec)
    40. mysql> kill proxysession 9 10;
    41. Query OK, 0 rows affected (0.00 sec)
    42. mysql> show proxysession attribute;
    43. +------------------------+---------------------+----------------+
    44. | attribute_name | value | info |
    45. +------------------------+---------------------+----------------+
    46. | proxy_sessid | 756006681247547402 | cs common |
    47. | cs_id | 9 | cs common |
    48. | cluster | ob1.jianhua.sjh | cs common |
    49. | tenant | sys | cs common |
    50. | user | root | cs common |
    51. | host_ip | 127.0.0.1 | cs common |
    52. | host_port | 23734 | cs common |
    53. | db | NULL | cs common |
    54. | total_trans_cnt | 0 | cs common |
    55. | svr_session_cnt | 0 | cs common |
    56. | active | true | cs common |
    57. | read_state | MCS_ACTIVE_READER | cs common |
    58. | tid | 2230520 | cs common |
    59. | pid | 2230520 | cs common |
    60. | modified_time | 1469436218332107523 | cs stat |
    61. | reported_time | 1469436218332175341 | cs stat |
    62. | hot_sys_var_version | 0 | cs var version |
    63. | sys_var_version | 0 | cs var version |
    64. | user_var_version | 0 | cs var version |
    65. | last_insert_id_version | 0 | cs var version |
    66. | db_name_version | 0 | cs var version |
    67. +------------------------+---------------------+----------------+
    68. 21 rows in set (0.00 sec)
    69. mysql> select connection_id();
    70. +-----------------+
    71. | connection_id() |
    72. +-----------------+
    73. | 2147614732 |
    74. +-----------------+
    75. 1 row in set (0.01 sec)
    76. mysql> show proxysession attribute;
    77. +------------------------+---------------------+----------------+
    78. | attribute_name | value | info |
    79. +------------------------+---------------------+----------------+
    80. | proxy_sessid | 756006681247547402 | cs common |
    81. | cs_id | 9 | cs common |
    82. | cluster | ob1.jianhua.sjh | cs common |
    83. | tenant | sys | cs common |
    84. | user | root | cs common |
    85. | host_ip | 127.0.0.1 | cs common |
    86. | host_port | 23734 | cs common |
    87. | db | NULL | cs common |
    88. | total_trans_cnt | 0 | cs common |
    89. | svr_session_cnt | 1 | cs common |
    90. | active | true | cs common |
    91. | read_state | MCS_ACTIVE_READER | cs common |
    92. | tid | 2230520 | cs common |
    93. | pid | 2230520 | cs common |
    94. | modified_time | 1469436224790015422 | cs stat |
    95. | reported_time | 1469436224791042749 | cs stat |
    96. | hot_sys_var_version | 0 | cs var version |
    97. | sys_var_version | 0 | cs var version |
    98. | user_var_version | 0 | cs var version |
    99. | last_insert_id_version | 0 | cs var version |
    100. | db_name_version | 0 | cs var version |
    101. | server_ip | 10.244.4.27 | last used ss |
    102. | server_port | 13201 | last used ss |
    103. | server_sessid | 2147614732 | last used ss |
    104. | ss_id | 11 | last used ss |
    105. | state | MSS_KA_CLIENT_SLAVE | last used ss |
    106. | transact_count | 1 | last used ss |
    107. | server_trans_stat | 0 | last used ss |
    108. | hot_sys_var_version | 0 | last used ss |
    109. | sys_var_version | 0 | last used ss |
    110. | user_var_version | 0 | last used ss |
    111. | last_insert_id_version | 0 | last used ss |
    112. | db_name_version | 0 | last used ss |
    113. +------------------------+---------------------+----------------+
    114. 33 rows in set (0.00 sec)
    115. mysql> kill proxysession 2147614732 11;
    116. Query OK, 0 rows affected (0.00 sec)
    117. mysql> show proxysession attribute;
    118. +------------------------+---------------------+----------------+
    119. | attribute_name | value | info |
    120. +------------------------+---------------------+----------------+
    121. | proxy_sessid | 756006681247547402 | cs common |
    122. | cs_id | 9 | cs common |
    123. | cluster | ob1.jianhua.sjh | cs common |
    124. | tenant | sys | cs common |
    125. | user | root | cs common |
    126. | host_ip | 127.0.0.1 | cs common |
    127. | host_port | 23734 | cs common |
    128. | db | NULL | cs common |
    129. | total_trans_cnt | 0 | cs common |
    130. | svr_session_cnt | 0 | cs common |
    131. | active | true | cs common |
    132. | read_state | MCS_ACTIVE_READER | cs common |
    133. | tid | 2230520 | cs common |
    134. | pid | 2230520 | cs common |
    135. | modified_time | 1469436238254131223 | cs stat |
    136. | reported_time | 1469436238254131223 | cs stat |
    137. | hot_sys_var_version | 0 | cs var version |
    138. | sys_var_version | 0 | cs var version |
    139. | user_var_version | 0 | cs var version |
    140. | last_insert_id_version | 0 | cs var version |
    141. | db_name_version | 0 | cs var version |
    142. +------------------------+---------------------+----------------+
    143. 21 rows in set (0.00 sec)