原 GreenPlum登录报错 ERROR: deadlock detected, locking against self
现象
GreenPlum普通用户使用Navicat登录数据库报错:ERROR: deadlock detected, locking against self,但使用psql可以正常登录:
分析
查询如下的SQL获取用户的资源队列的内存限制:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | SELECT pr.rolname,pr.rolconnlimit, d.queueid,d.rsqname, d.rsqcountlimit,d.rsqcountvalue, d.rsqcostvalue,d.rsqcostlimit, ( CASE WHEN rsqmemorylimit = -1 THEN '-1' WHEN rsqmemorylimit >= 1e9 THEN trunc(rsqmemorylimit / 1e9)::bigint || ' GB' WHEN rsqmemorylimit >= 1e6 THEN trunc(rsqmemorylimit / 1e6)::bigint || ' MB' WHEN rsqmemorylimit >= 1e3 THEN trunc(rsqmemorylimit / 1e3)::bigint || ' KB' ELSE rsqmemorylimit::bigint || ' B' END ) AS rsqmemorylimit_GB, ( CASE WHEN rsqmemoryvalue = -1 THEN '-1' WHEN rsqmemoryvalue >= 1e9 THEN trunc(rsqmemoryvalue / 1e9)::bigint || ' GB' WHEN rsqmemoryvalue >= 1e6 THEN trunc(rsqmemoryvalue / 1e6)::bigint || ' MB' WHEN rsqmemoryvalue >= 1e3 THEN trunc(rsqmemoryvalue / 1e3)::bigint || ' KB' ELSE rsqmemoryvalue::bigint || ' B' END ) AS rsqmemoryvalue_GB, d.rsqwaiters, d.rsqholders FROM gp_toolkit.gp_resqueue_status d, pg_roles pr WHERE d.queueid=pr.rolresqueue order by pr.rolname ; |
若内存较低,则需要调整参数statement_mem的值,让statement_mem的值小于rsqmemorylimit的值才可以。
解决
调小statement_mem配置参数值: