matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.79k stars 276 forks source link

[Bug]: connection cannot be migrated if the last SQL encounters error #17688

Closed aylei closed 14 hours ago

aylei commented 3 months ago

Is there an existing issue for the same bug?

Branch Name

v1.2.2

Commit ID

dc29a3623

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

proxy-proxy-dxxgg main {"level":"INFO","time":"2024/07/24 04:20:11.697645 +0000","name":"proxy-service","caller":"proxy/tunnel_deliver.go:58","msg":"tunnel is already in transfer, skip transfer","uuid":"64366336-3939-3934-3935-383061633334","conn ID":338620212}
proxy-proxy-dxxgg main {"level":"INFO","time":"2024/07/24 04:20:14.698296 +0000","name":"proxy-service","caller":"proxy/tunnel_deliver.go:58","msg":"tunnel is already in transfer, skip transfer","uuid":"64366336-3939-3934-3935-383061633334","conn ID":338620212}

Idle session cannot be migrated

Expected Behavior

No response

Steps to Reproduce

1. Open a session
2. Execute a SQL that has syntax error:

mysql> syntaxerror;
ERROR 1064 (HY000): SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 11 near "syntaxerror";
  1. offline the CN, the session cannot be migrated.

Additional information

No response

volgariver6 commented 3 months ago

fixed

aylei commented 2 months ago

待验证

aylei commented 2 months ago

待验证

aylei commented 2 months ago

待验证

aylei commented 2 months ago

验证没问题了, 转测

mysql> select * from processlist() a where conn_id=connection_id();
+--------------------------------------+-----------+--------------------------------------+---------+------+--------------------+------+----------------------------+-----------+-------------------------------------------------------------+----------------------------------+--------------------------------------+----------------+------------+-----------------+----------------------------+----------------------+---------+---------------------+
| node_id                              | conn_id   | session_id                           | account | user | host               | db   | session_start              | command   | info                                                        | txn_id                           | statement_id                         | statement_type | query_type | sql_source_type | query_start                | client_host          | role    | proxy_host          |
+--------------------------------------+-----------+--------------------------------------+---------+------+--------------------+------+----------------------------+-----------+-------------------------------------------------------------+----------------------------------+--------------------------------------+----------------+------------+-----------------+----------------------------+----------------------+---------+---------------------+
| 31653161-6365-3234-3831-633333613766 | 365801705 | 019153b4-c3ad-7a22-9e63-60fe59f3b253 | sys     | dump | 172.20.20.132:6001 |      | 2024-08-15 01:44:01.197654 | COM_QUERY | select * from processlist() a where conn_id=connection_id() | 019153b4c89f77b6839f569099136cd9 | 019153b4-c89f-7702-b924-cf23d824bf48 | Select         | DQL        | external_sql    | 2024-08-15 01:44:02.463490 | 183.159.77.136:35664 | moadmin | 172.20.52.130:44464 |
+--------------------------------------+-----------+--------------------------------------+---------+------+--------------------+------+----------------------------+-----------+-------------------------------------------------------------+----------------------------------+--------------------------------------+----------------+------------+-----------------+----------------------------+----------------------+---------+---------------------+
1 row in set (0.10 sec)

mysql> fsfs;
ERROR 1064 (HY000): SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 4 near "fsfs";
mysql> select * from processlist() a where conn_id=connection_id();
+--------------------------------------+-----------+--------------------------------------+---------+------+--------------------+------+----------------------------+-----------+-------------------------------------------------------------+----------------------------------+--------------------------------------+----------------+------------+-----------------+----------------------------+----------------------+---------+---------------------+
| node_id                              | conn_id   | session_id                           | account | user | host               | db   | session_start              | command   | info                                                        | txn_id                           | statement_id                         | statement_type | query_type | sql_source_type | query_start                | client_host          | role    | proxy_host          |
+--------------------------------------+-----------+--------------------------------------+---------+------+--------------------+------+----------------------------+-----------+-------------------------------------------------------------+----------------------------------+--------------------------------------+----------------+------------+-----------------+----------------------------+----------------------+---------+---------------------+
| 39636333-3732-6639-3030-356365326431 | 365801705 | 019153b5-5726-7206-b339-1003b23586d0 | sys     | dump | 172.20.48.135:6001 |      | 2024-08-15 01:44:38.950127 | COM_QUERY | select * from processlist() a where conn_id=connection_id() | 019153b55d067714b5053c3064f11470 | 019153b5-5d06-76ce-af57-b61b9b6479a1 | Select         | DQL        | external_sql    | 2024-08-15 01:44:40.454458 | 183.159.77.136:35664 | moadmin | 172.20.52.130:42096 |
+--------------------------------------+-----------+--------------------------------------+---------+------+--------------------+------+----------------------------+-----------+-------------------------------------------------------------+----------------------------------+--------------------------------------+----------------+------------+-----------------+----------------------------+----------------------+---------+---------------------+
1 row in set (0.02 sec)
TangxingZhou commented 2 months ago

测试验证通过