Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jd-zhang opened this issue Jul 11, 2022 · 2 comments
Open

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

jd-zhang opened this issue Jul 11, 2022 · 2 comments

Comments

@jd-zhang
Copy link
Contributor

*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
Copy link
Contributor Author

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

@jd-zhang
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant