[HCS]集群数据库用户管理查询等操作超时
1、问题背景:集群的数据库用户管理功能操作耗时较长
2、浏览器按F12进入调试模式发现请求报错超时,根据业务逻辑是使用rpc下发命令到第一个cn节点执行sql,因此登录xxx-dws-cn-cn-1-1节点,查看接收命执行情况,发现sql执行耗时较长,30s+
3、手动执行该sql然后查看线程等待视图,发现等待io
4、怀疑是脏页率过高导致执行的比较慢,发现系统表脏页率很高
5、给出查询各类资源的用户列表及权限的sql,后面协调时间做系统表脏页清理vacuum full
手动提供各个权限查询的sql语句:
SELECT case c.relkind when 'r' then 'table' when 'v' then 'view' when 'S' then 'sequence' end as type,
nsp.nspname, c.relname AS name, c.relacl AS acl FROM pg_class c LEFT JOIN pg_namespace nsp ON c.relnamespace = nsp.oid
WHERE c.relacl is not null and c.relkind IN ('r') and c.relacl::varchar like '%%'
SELECT 'database' as type, datname AS name, datacl AS acl FROM pg_database WHERE datacl is not null and datacl::varchar like '%%'
SELECT 'function' as type,
nsp.nspname, proname||'('||pg_get_function_identity_arguments(p.oid)||')' AS name, p.proacl AS acl
FROM pg_proc p LEFT JOIN pg_namespace nsp ON p.pronamespace = nsp.oid WHERE p.proacl is not null and p.proacl::varchar like '%%'
SELECT 'schema' as type, nspname AS name,
nspacl AS acl FROM pg_namespace WHERE nspacl is not null and nspacl::varchar like '%%'
select * from pg_roles where
revoke语法参考;https://support.huaweicloud.com/sqlreference-910-dws/dws_06_0253.html
权限说明文档:https://support.huaweicloud.com/devg-910-dws/dws_04_0578.html
- 点赞
- 收藏
- 关注作者
评论(0)