matrixorigin / matrixone

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

[Bug]: Connection persists after an account is suspended #15202

Closed DanielZhangQD closed 2 months ago

DanielZhangQD commented 7 months ago

Is there an existing issue for the same bug?

Branch Name

1.1-dev

Commit ID

v1.1.2-c66ab12ea-2024-03-27

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

Expected Behavior

To be determined by the PM

Steps to Reproduce

Refer to Actual Behavior

Additional information

No response

LiSong0214 commented 7 months ago

yes, it's a bug. when account suspend, no connection can be run immediately

YANGGMM commented 7 months ago

still working

YANGGMM commented 7 months ago
create account abc ADMIN_NAME 'admin' IDENTIFIED BY '123456';

--mysql -h127.0.0.1 -uabc:admin -P6009 -p123456
show databases;

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mo_catalog         |
| mysql              |
| system             |
| system_metrics     |
+--------------------+
5 rows in set (0.01 sec)

alter account  abc suspend;

show databases;

mysql> show databases;
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user abc:admin. internal error: Account abc is suspended
ERROR: 
Can't connect to the server

main 上没有复现

YANGGMM commented 7 months ago

mysql> alter account abc restricted;
Query OK, 0 rows affected (0.02 sec)

--mysql -h127.0.0.1 -uabc:admin -P6009 -p123456

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mo_catalog         |
| mysql              |
| system             |
| system_metrics     |
+--------------------+
5 rows in set (0.01 sec)

mysql> 
mysql> 
mysql> create database test;
ERROR 20101 (HY000): internal error: do not have privilege to execute the statement
YANGGMM commented 7 months ago

在1.1-dev 上

mysql> create account abc ADMIN_NAME 'admin' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.33 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| mo_catalog         |
| system             |
| system_metrics     |
| information_schema |
| mysql              |
+--------------------+
5 rows in set (0.01 sec)

mysql> 

mysql> alter account  abc suspend;
Query OK, 0 rows affected (0.02 sec)

mysql> show databases;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user abc:admin. internal error: Account abc is suspended
ERROR: 
Can't connect to the server
YANGGMM commented 7 months ago
mysql> alter account abc restricted;
Query OK, 0 rows affected (0.02 sec)
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| mo_catalog         |
| system             |
| system_metrics     |
| information_schema |
| mysql              |
+--------------------+
5 rows in set (0.01 sec)

mysql> create database test;
ERROR 20101 (HY000): internal error: do not have privilege to execute the statement
mysql> 
mysql> 
mysql> load data inline format='csv', data='1000-01-01,0001-01-01,1970-01-01 00:00:01,0
    '> 9999-12-31,9999-12-31,2038-01-19,1
    '> ' into table t4;
ERROR 20101 (HY000): internal error: do not have privilege to execute the statement
YANGGMM commented 7 months ago
mysql> alter account abc restricted;
Query OK, 0 rows affected (0.02 sec)
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| mo_catalog         |
| system             |
| system_metrics     |
| information_schema |
| mysql              |
+--------------------+
5 rows in set (0.01 sec)

mysql> create database test;
ERROR 20101 (HY000): internal error: do not have privilege to execute the statement
mysql> 
mysql> 
mysql> load data inline format='csv', data='1000-01-01,0001-01-01,1970-01-01 00:00:01,0
    '> 9999-12-31,9999-12-31,2038-01-19,1
    '> ' into table t4;
ERROR 20101 (HY000): internal error: do not have privilege to execute the statement
YANGGMM commented 7 months ago

cloud 测试 测试环境有问题,等后面再看

YANGGMM commented 7 months ago

等待复现

YANGGMM commented 6 months ago

still working

YANGGMM commented 6 months ago

still working

YANGGMM commented 6 months ago

dev 环境现在有问题

image

create account 之后登陆Auth failed: info: access denied

YANGGMM commented 6 months ago
{"level":"ERROR","time":"2024/05/08 03:49:02.327386 +0000","name":"proxy-service","caller":"proxy/handler.go:168","msg":"failed to create server conn","uuid":"65303461-6530-6664-6239-666238333231","error":"Auth failed: info: access denied for account acc_idx"}
{"level":"ERROR","time":"2024/05/08 03:49:02.327365 +0000","name":"proxy-service","caller":"proxy/client_conn.go:281","msg":"failed to connect to backend","uuid":"65303461-6530-6664-6239-666238333231","error":"Auth failed: info: access denied for account acc_idx"}
{"level":"ERROR","time":"2024/05/08 03:49:02.327317 +0000","caller":"proxy/plugin.go:76","msg":"error: info: access denied for account acc_idx"}
{"level":"error","ts":"2024-05-08T03:49:02Z","caller":"handler/handler.go:116","msg":"get tenant cluster failed","error":"internal error: cluster not found for tenant acc_idx","stacktrace":"github.com/matrixone-cloud/plugin/pkg/handler.(*Handler).handle\n\t/workspace/pkg/handler/handler.go:116\ngithub.com/matrixone-cloud/plugin/pkg/handler.(*Handler).HandleRequest.func1\n\t/workspace/pkg/handler/handler.go:103"}
2024/05/08 03:49:02.326915 +0000 DEBUG received request {"name": "proxy-plugin", "sequence": 1729320, "client": "127.0.0.1:46398", "request-id": 1729320, "request": "1729320: tenant:\"acc_idx\" username:\"root\" originIP:\"116.230.67.64\" labelSelector:<key:\"account\" value:\"acc_idx\" > /"}
YANGGMM commented 6 months ago

在dev 环境下复现成功

YANGGMM commented 6 months ago

先忙其他事情

YANGGMM commented 6 months ago

still working

YANGGMM commented 5 months ago

still working

YANGGMM commented 5 months ago

still working

YANGGMM commented 5 months ago

still working

YANGGMM commented 5 months ago

还在看

YANGGMM commented 5 months ago

还在看

YANGGMM commented 5 months ago

还在看

YANGGMM commented 5 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

tianyahui-python commented 4 months ago

当前bug 会导致cloud 功能受影响, 而且长时间没有进度, 升级为s-1

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

测试记录

mo 版本 main
commit 8a1e5f653b9599c45338daca98f6b0027e366da4 
Author: nitao <badboynt@126.com>
Date:   Wed Jul 3 15:54:00 2024 +0800

    fix a bug that cause wrong parallelism for tpch (#17296)

    fix a bug that cause wrong parallelism for tpch

    Approved by: @ouyuanning, @m-schen

通过proxy 方式启动
 matrixone git:(fix-15202-1) ✗ ./mo-service -cfg etc/launch-with-proxy/log.toml > log.log 2>&1 &
[1] 19479
matrixone git:(fix-15202-1) ✗ ./mo-service -cfg etc/launch-with-proxy/tn.toml > tn.log 2>&1 &
[2] 19504
 matrixone git:(fix-15202-1) ✗ ./mo-service -cfg etc/launch-with-proxy/cn1.toml > cn1.log 2>&1 &
[3] 19530
 matrixone git:(fix-15202-1) ✗ ./mo-service -cfg etc/launch-with-proxy/cn2.toml >cn2.log 2>&1 &
[4] 19552
matrixone git:(fix-15202-1) ✗ ./mo-service -cfg etc/launch-with-proxy/proxy.toml > proxy.log 2>&1 &
[5] 19571

sys 租户登陆
➜  ~ mysql -h127.0.0.1 -udump -P6009 -p111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 201
Server version: 8.0.30-MatrixOne-v54256 MatrixOne

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
mysql> 
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mo_catalog         |
| mo_debug           |
| mo_task            |
| mysql              |
| system             |
| system_metrics     |
+--------------------+
7 rows in set (0.01 sec)

mysql> 
mysql> 
mysql> drop account if exists acc01;
Query OK, 0 rows affected (0.01 sec)

mysql> create account acc01 admin_name = 'test_account' identified by '111';
Query OK, 0 rows affected (0.52 sec)

acc01 登陆

➜  ~  mysql -h127.0.0.1 -uacc01:test_account -P6009 -p111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 202
Server version: 8.0.30-MatrixOne-v54256 MatrixOne

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mo_catalog         |
| mysql              |
| system             |
| system_metrics     |
+--------------------+
5 rows in set (0.01 sec)

mysql> create database abc;
Query OK, 1 row affected (0.02 sec)

系统租户更改普通租户状态

mysql> alter account acc01 suspend;
Query OK, 0 rows affected (0.01 sec)

查看普通租户

mysql> show databases;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user acc01:test_account. internal error: Account acc01 is suspended
ERROR: 
Can't connect to the server

没有复现

YANGGMM commented 4 months ago

1.2-dev 测试记录

commit c71c20e8b72ebea52d95153c5d4f88012620f73f (HEAD -> account-status, upstream/1.2-dev)
Author: davis zhen <daviszhen007@gmail.com>
Date:   Thu Jul 4 02:53:39 2024 +0800

    fix dual (#17279)

    对dual的修改:

    CASE 1:
    create table `dual`(a int);
    select * from dual;
    mysql responses:  No tables used
    mo和mysql认为是占位符。

    CASE 2: select * from `dual`;
    create table `dual`(a int);
    select * from `dual`;
    mysql responses: success.
    mysql认为是正常表。
    mo认为是占位符。这与mysql不同。目前的parser不好改为同mysql一致。

    CASE 3:
    create table `dual`(a int);
    select * from db.dual;
    select * from icp.`dual`;
    mysql responses: success.
    mysql和mo都认为是正常表。

    Approved by: @badboynt1, @zhangxu19830126, @ouyuanning, @aressu1985, @sukki37

通过proxy 方式启动

matrixone git:(account-status) ✗ ./mo-service -cfg etc/launch-with-proxy/log.toml > log.log 2>&1 &
[1] 21809
 matrixone git:(account-status) ✗ ./mo-service -cfg etc/launch-with-proxy/tn.toml > tn.log 2>&1 &
[2] 21827
 matrixone git:(account-status) ✗ ./mo-service -cfg etc/launch-with-proxy/cn1.toml > cn1.log 2>&1 &
[3] 21845
matrixone git:(account-status) ✗ ./mo-service -cfg etc/launch-with-proxy/cn2.toml >cn2.log 2>&1 &
[4] 21866
 matrixone git:(account-status) ✗ ./mo-service -cfg etc/launch-with-proxy/proxy.toml > proxy.log 2>&1 &
[5] 21885

sys 租户登陆
➜  ~ mysql -h127.0.0.1 -udump -P6009 -p111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 201
Server version: 8.0.30-MatrixOne-v54256 MatrixOne

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mo_catalog         |
| mo_debug           |
| mo_task            |
| mysql              |
| system             |
| system_metrics     |
+--------------------+
7 rows in set (0.01 sec)

mysql> drop account if exists acc01;
Query OK, 0 rows affected (0.01 sec)

mysql> create account acc01 admin_name = 'test_account' identified by '111';
Query OK, 0 rows affected (0.50 sec)

mysql> 

acc01 登陆

➜  ~  mysql -h127.0.0.1 -uacc01:test_account -P6009 -p111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 202
Server version: 8.0.30-MatrixOne-v54256 MatrixOne

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show accounts;
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-04 02:39:25 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

系统租户更改普通租户状态

mysql> alter account acc01 suspend;
Query OK, 0 rows affected (0.01 sec)

查看普通租户
mysql> show accounts;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user acc01:test_account. internal error: Account acc01 is suspended
ERROR: 
Can't connect to the server
TangxingZhou commented 4 months ago

v1.2.1-27b34c670-2024-06-28 未复现

YANGGMM commented 4 months ago

v1.2.1-27b34c670-2024-06-28 未复现

image
YANGGMM commented 4 months ago

restricted 测试

main

mo version
commit 8a1e5f653b9599c45338daca98f6b0027e366da4 (HEAD -> fix-15202-1, origin/main, origin/HEAD, main)
Author: nitao <badboynt@126.com>
Date:   Wed Jul 3 15:54:00 2024 +0800

    fix a bug that cause wrong parallelism for tpch (#17296)

    fix a bug that cause wrong parallelism for tpch

    Approved by: @ouyuanning, @m-schen

通过proxy 方式启动

➜  matrixone git:(fix-15202-1) ./mo-service -cfg etc/launch-with-proxy/log.toml > log.log 2>&1 &
[1] 28558
➜  matrixone git:(fix-15202-1) ✗ ./mo-service -cfg etc/launch-with-proxy/tn.toml > tn.log 2>&1 &
[2] 28586
➜  matrixone git:(fix-15202-1) ✗ ./mo-service -cfg etc/launch-with-proxy/cn1.toml > cn1.log 2>&1 &
[3] 28604
➜  matrixone git:(fix-15202-1) ✗ ./mo-service -cfg etc/launch-with-proxy/cn2.toml >cn2.log 2>&1 &
[4] 28626
➜  matrixone git:(fix-15202-1) ✗ ./mo-service -cfg etc/launch-with-proxy/proxy.toml > proxy.log 2>&1 &
[5] 28645

sys 租户登陆

➜  matrixone git:(fix-15202-1) ✗ mysql -h127.0.0.1 -udump -P6009 -p111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 101
Server version: 8.0.30-MatrixOne-v54256 MatrixOne

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mo_catalog         |
| mo_debug           |
| mo_task            |
| mysql              |
| system             |
| system_metrics     |
+--------------------+
7 rows in set (0.00 sec)

mysql> drop account if exists acc01;
Query OK, 0 rows affected (0.00 sec)

mysql> create account acc01 admin_name = 'test_account' identified by '111';
Query OK, 0 rows affected (0.51 sec)

acc01 登陆
➜  ~ mysql -h127.0.0.1 -uacc01:test_account -P6009 -p111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 102
Server version: 8.0.30-MatrixOne-v54256 MatrixOne

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
mysql> 
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mo_catalog         |
| mysql              |
| system             |
| system_metrics     |
+--------------------+
5 rows in set (0.00 sec)

mysql> show accounts;
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-04 06:09:31 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> create database test;
Query OK, 1 row affected (0.02 sec)

mysql> use test;
Database changed
mysql> 
mysql> create table tt(a int);
Query OK, 0 rows affected (0.02 sec)

mysql> insert into tt values(1);
Query OK, 1 row affected (0.01 sec)

系统租户更改普通租户状态

mysql> alter account acc01 restricted;
Query OK, 0 rows affected (0.01 sec)

查看普通租户
mysql> show accounts;
+--------------+--------------+---------------------+------------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status     | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+------------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-04 06:09:31 | restricted | 2024-07-04 06:10:53 |        6 |        64 |    0 |          |
+--------------+--------------+---------------------+------------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> insert into tt values(1);
ERROR 20101 (HY000): internal error: do not have privilege to execute the statement
YANGGMM commented 4 months ago

1.2-dev

mo version

commit c71c20e8b72ebea52d95153c5d4f88012620f73f (HEAD -> account-status, upstream/1.2-dev)
Author: davis zhen <daviszhen007@gmail.com>
Date:   Thu Jul 4 02:53:39 2024 +0800

    fix dual (#17279)

    对dual的修改:

    CASE 1:
    create table `dual`(a int);
    select * from dual;
    mysql responses:  No tables used
    mo和mysql认为是占位符。

    CASE 2: select * from `dual`;
    create table `dual`(a int);
    select * from `dual`;
    mysql responses: success.
    mysql认为是正常表。
    mo认为是占位符。这与mysql不同。目前的parser不好改为同mysql一致。

    CASE 3:
    create table `dual`(a int);
    select * from db.dual;
    select * from icp.`dual`;
    mysql responses: success.
    mysql和mo都认为是正常表。

    Approved by: @badboynt1, @zhangxu19830126, @ouyuanning, @aressu1985, @sukki37

通过proxy 方式启动

➜  matrixone git:(account-status) ✗ ./mo-service -cfg etc/launch-with-proxy/log.toml > log.log 2>&1 &
[1] 29689
➜  matrixone git:(account-status) ✗ ./mo-service -cfg etc/launch-with-proxy/tn.toml > tn.log 2>&1 &
[2] 29710
➜  matrixone git:(account-status) ✗ ./mo-service -cfg etc/launch-with-proxy/cn1.toml > cn1.log 2>&1 &
[3] 29731
➜  matrixone git:(account-status) ✗ ./mo-service -cfg etc/launch-with-proxy/cn2.toml >cn2.log 2>&1 &
[4] 29749
➜  matrixone git:(account-status) ✗ ./mo-service -cfg etc/launch-with-proxy/proxy.toml > proxy.log 2>&1 &
[5] 29768

sys 租户登陆

➜  matrixone git:(account-status) ✗ mysql -h127.0.0.1 -udump -P6009 -p111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 201
Server version: 8.0.30-MatrixOne-v54256 MatrixOne

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mo_catalog         |
| mo_debug           |
| mo_task            |
| mysql              |
| system             |
| system_metrics     |
+--------------------+
7 rows in set (0.00 sec)

mysql> drop account if exists acc01;
Query OK, 0 rows affected (0.01 sec)

mysql> create account acc01 admin_name = 'test_account' identified by '111';
Query OK, 0 rows affected (0.54 sec)

mysql> show accounts;
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments       |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------------+
| sys          | root         | 2024-07-04 06:15:00 | open   | NULL           |        7 |        97 |    0 | system account |
| acc01        | test_account | 2024-07-04 06:15:24 | open   | NULL           |        5 |        63 |    0 |                |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------------+
2 rows in set (0.01 sec)

acc01 登陆

➜  ~ mysql -h127.0.0.1 -uacc01:test_account -P6009 -p111
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 202
Server version: 8.0.30-MatrixOne-v54256 MatrixOne

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
mysql> 
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mo_catalog         |
| mysql              |
| system             |
| system_metrics     |
+--------------------+
5 rows in set (0.00 sec)

mysql> show accounts;
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-04 06:15:24 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> create database test;
Query OK, 1 row affected (0.02 sec)

mysql> use test;
Database changed
mysql> create table tt(a int);
Query OK, 0 rows affected (0.02 sec)

mysql> insert into tt values(1);
Query OK, 1 row affected (0.01 sec)

系统租户更改普通租户状态

mysql> alter account acc01 restricted;
Query OK, 0 rows affected (0.01 sec)

查看普通租户

mysql> show accounts;
+--------------+--------------+---------------------+------------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status     | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+------------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-04 06:15:24 | restricted | 2024-07-04 06:16:43 |        6 |        64 |    0 |          |
+--------------+--------------+---------------------+------------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> insert into tt values(1);
ERROR 20101 (HY000): internal error: do not have privilege to execute the statement
YANGGMM commented 4 months ago

在dev环境上测试出现问题

mysql> show accounts;
+--------------------------------------+------------+---------------------+------------+---------------------+----------+-----------+--------------+----------+
| account_name                         | admin_name | created_time        | status     | suspended_time      | db_count | tbl_count | size         | comments |
+--------------------------------------+------------+---------------------+------------+---------------------+----------+-----------+--------------+----------+
| 01907805-c832-7271-b7de-998b9ec20b35 | admin      | 2024-07-03 09:56:04 | restricted | 2024-07-04 03:40:05 |        9 |       108 | 37271.103673 |          |
+--------------------------------------+------------+---------------------+------------+---------------------+----------+-----------+--------------+----------+
1 row in set (0.43 sec)

mysql> 
mysql> 
mysql> create database abc;
Query OK, 1 row affected (0.04 sec)

mysql> use abc;
Database changed
mysql> 
mysql> 
mysql> create table tt(a int);
Query OK, 0 rows affected (0.25 sec)

mysql> insert into tt values(1);
Query OK, 1 row affected (0.03 sec)
YANGGMM commented 4 months ago

需要等pr合进去然后在qa环境看看

YANGGMM commented 4 months ago

等pr合进去

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

tianyahui-python commented 4 months ago
截屏2024-07-15 16 16 40 截屏2024-07-15 16 16 49
TangxingZhou commented 4 months ago

serverless免费实例CU超限(旧连接断开) serverless付费实例spend_limit_no_servering(旧连接没有断开) serverless实例终止和恢复(旧连接没有断开) standard实例退订和续费(旧连接断开) 账户欠费(旧连接没有断开) 实例不可用(旧连接断开)

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 4 months ago

还在看

YANGGMM commented 3 months ago

还在看

YANGGMM commented 3 months ago

mysql> select version(); +-------------------------+ | version() | +-------------------------+ | 8.0.30-MatrixOne-v1.2.2 | +-------------------------+ 1 row in set (0.02 sec)

mysql> mysql> mysql> select git_version(); +---------------+ | git_version() | +---------------+ | ebcfce8e5 | +---------------+ 1 row in set (0.02 sec)

YANGGMM commented 3 months ago

不稳定复现,频繁alter account status 后会出现

YANGGMM commented 3 months ago
mysql> show accounts;
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:05:52 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:05:52 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:05:52 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:05:52 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user acc01:test_account. internal error: Account acc01 is suspended
ERROR: 
Can't connect to the server

mysql> show accounts;
No connection. Trying to reconnect...
Connection id:    204
Current database: *** NONE ***

+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.00 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:11 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:11 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user acc01:test_account. internal error: Account acc01 is suspended
ERROR: 
Can't connect to the server

mysql> show accounts;
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user acc01:test_account. internal error: Account acc01 is suspended
ERROR: 
Can't connect to the server

mysql> show accounts;
No connection. Trying to reconnect...
Connection id:    207
Current database: *** NONE ***

+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.00 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:25 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:25 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:25 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user acc01:test_account. internal error: Account acc01 is suspended
ERROR: 
Can't connect to the server

mysql> show accounts;
No connection. Trying to reconnect...
Connection id:    209
Current database: *** NONE ***

+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.00 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.00 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:07:41 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.00 sec)

mysql> show accounts;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user acc01:test_account. internal error: Account acc01 is suspended
ERROR: 
Can't connect to the server

mysql> show accounts;
No connection. Trying to reconnect...
Connection id:    211
Current database: *** NONE ***

+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:08:54 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:08:54 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.00 sec)

mysql> show accounts;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user acc01:test_account. internal error: Account acc01 is suspended
ERROR: 
Can't connect to the server

mysql> show accounts;
No connection. Trying to reconnect...
Connection id:    213
Current database: *** NONE ***

+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status | suspended_time | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | open   | NULL           |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+--------+----------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:09:15 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:09:15 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| account_name | admin_name   | created_time        | status  | suspended_time      | db_count | tbl_count | size | comments |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
| acc01        | test_account | 2024-07-22 06:05:17 | suspend | 2024-07-22 06:09:15 |        5 |        63 |    0 |          |
+--------------+--------------+---------------------+---------+---------------------+----------+-----------+------+----------+
1 row in set (0.01 sec)

mysql> show accounts;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 1045 (28000): Access denied for user acc01:test_account. internal error: Account acc01 is suspended
ERROR: 
Can't connect to the server

1.2-dev 上没有复现