zettadb / kunlun

KunlunBase is a distributed relational database management system(RDBMS) with complete NewSQL capabilities and robust transaction ACID guarantees and is compatible with standard SQL. Applications which used PostgreSQL or MySQL can work with KunlunBase as-is without any code change or rebuild because KunlunBase supports both PostgreSQL and MySQL connection protocols and DML SQL grammars. MySQL DBAs can quickly work on a KunlunBase cluster because we use MySQL as storage nodes of KunlunBase. KunlunBase can elastically scale out as needed, and guarantees transaction ACID under error conditions, and KunlunBase fully passes TPC-C, TPC-H and TPC-DS test suites, so it not only support OLTP workloads but also OLAP workloads. Application developers can use KunlunBase to build IT systems that handles terabytes of data, without any effort on their part to implement data sharding, distributed transaction processing, distributed query processing, crash safety, high availability, strong consistency, horizontal scalability. All these powerful features are provided by KunlunBase. KunlunBase supports powerful and user friendly cluster management, monitor and provision features, can be readily used as DBaaS.
http://www.kunlunbase.com
Apache License 2.0
143 stars 20 forks source link

analyze导致计算节点ddl重放报错 #797

Open jd-zhang opened 2 years ago

jd-zhang commented 2 years ago

Issue migrated from trac ticket # 894 www.kunlunbase.com

component: computing nodes | priority: major

2022-07-11 15:25:43: smith created the issue


** analyze的执行逻辑

1、计算节点向存储节点发送analyze命令;
2、从存储节点读取表的统计信息;
3、根据(2)生成对系统表的update/insert语句,例如:
 UPDATE pg_class SET relpages=97,
         reltuples=16341
  WHERE relname='t1'
        AND relnamespace = 
    (SELECT oid
    FROM pg_namespace
    WHERE nspname = 'public')

-* 问题

1、步骤一没有检查用户的权限;
2、其他计算节点执行(3)的sql时,使用的是最开始执行analyze的用户,而该用户可能没有对应的权限,导致ddl复制卡住。

-* 复现

create user test;
create table t1(a int, b int);
set role test;
analyze t1; -- 预期warning
create table t2(a int, b int);
analyze t2; -- 预期其他计算节点ddl复制进程卡住
jd-zhang commented 2 years ago

2022-07-11 16:45:15: smith edited the issue description

jd-zhang commented 2 years ago

2022-07-11 16:45:15: smith changed status from new to accepted