元数据异常
 
通知
清除全部

元数据异常


shubifeng
帖子: 10
Topic starter
青梅新星
已加入: 3年 前

描述问题:

执行 VACUUM FULL pg_catalog.pg_class; VACUUM FULL pg_catalog.pg_attribute; 后无法 ddl/dml相关语句受影响。

 

数据库版本:GPDB6.0

 

执行gpcheckcat如下报错信息:

..........省略
[ERROR] executing: Inconsistent entries check for pg_user_mapping
Execution error: ERROR: catalog is missing 5 attribute(s) for relid 5763384 (relcache.c:581)


SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;

SET gp_enable_mk_sort=off;

-- distribute catalog table from master, so that we can avoid to gather
CREATE TEMPORARY TABLE _tmp_master ON COMMIT DROP AS
SELECT gp_segment_id segid, oid,umuser,umserver,umoptions FROM pg_user_mapping;
SELECT oid,umuser,umserver,umoptions, array_agg(gp_segment_id order by gp_segment_id) as segids
FROM
(
SELECT DISTINCT
case when dcount <= (7+2)/2.0 then gp_segment_id else null end as gp_segment_id, oid,umuser,umserver,umoptions
FROM
(
select count(*) over (partition by oid,umuser,umserver,umoptions) as dcount,
count(*) over (partition by oid) as pcount,
gp_segment_id, oid,umuser,umserver,umoptions
from (
select segid gp_segment_id, oid AS oid,umuser AS umuser,umserver AS umserver,array_to_string(umoptions, ',') AS umoptions from _tmp_master
union all
select gp_segment_id, oid AS oid,umuser AS umuser,umserver AS umserver,array_to_string(umoptions, ',') AS umoptions
from gp_dist_random('pg_user_mapping')
) all_segments
) counted_segments
WHERE dcount != 7+2 and pcount = 7+2
ORDER BY oid, gp_segment_id
) rowresult
GROUP BY oid,umuser,umserver,umoptions
ORDER BY oid, segids;

Total runtime for test 'inconsistent': 005.26
Performing test 'foreign_key'
Total runtime for test 'foreign_key': 029.79
Performing test 'acl'
Total runtime for test 'acl': 007.15
Performing test 'pgclass'
Total runtime for test 'pgclass': 001.40
Performing test 'namespace'
Total runtime for test 'namespace': 000.38
Performing test 'distribution_policy'
Total runtime for test 'distribution_policy': 000.05
Performing test 'dependency'
Total runtime for test 'dependency': 009.81
Performing test 'owner'
Total runtime for test 'owner': 000.80
Performing test 'part_integrity'
Total runtime for test 'part_integrity': 000.84
Performing test 'part_constraint'
Total runtime for test 'part_constraint': 000.00
Performing test 'orphaned_toast_tables'
Total runtime for test 'orphaned_toast_tables': 001.13

SUMMARY REPORT
===================================================================
Completed 14 test(s) on database 'bizdata' at 2020-10-09 1313 with elapsed time 018
Found a total of 2 issue(s)

----------------------------------------------------
Object oid: 190607
Table name: pg_default_acl

Name of test which found this issue: dependency_pg_default_acl
Table pg_default_acl has a dependency issue on oid 190607 at content -1
Table pg_default_acl has a dependency issue on oid 190607 at content 0
Table pg_default_acl has a dependency issue on oid 190607 at content 1
Table pg_default_acl has a dependency issue on oid 190607 at content 2
Table pg_default_acl has a dependency issue on oid 190607 at content 3
Table pg_default_acl has a dependency issue on oid 190607 at content 4
Table pg_default_acl has a dependency issue on oid 190607 at content 5
Table pg_default_acl has a dependency issue on oid 190607 at content 6
Table pg_default_acl has a dependency issue on oid 190607 at content 7


----------------------------------------------------
Object oid: 841158
Table name: pg_default_acl

Name of test which found this issue: dependency_pg_default_acl
Table pg_default_acl has a dependency issue on oid 841158 at content -1
Table pg_default_acl has a dependency issue on oid 841158 at content 0
Table pg_default_acl has a dependency issue on oid 841158 at content 1
Table pg_default_acl has a dependency issue on oid 841158 at content 2
Table pg_default_acl has a dependency issue on oid 841158 at content 3
Table pg_default_acl has a dependency issue on oid 841158 at content 4
Table pg_default_acl has a dependency issue on oid 841158 at content 5
Table pg_default_acl has a dependency issue on oid 841158 at content 6
Table pg_default_acl has a dependency issue on oid 841158 at content 7


Failed test(s) that are not reported here: dependency
See /home/gpadmin/gpAdminLogs/gpcheckcat_20201009.log for detail



执行任意建表报错如下:

2 回复
阿福
帖子: 49
Greenplum专家
青梅少侠
已加入: 4年 前

你这是做了什么操作导致的?

回复
1 回复
shubifeng
已加入: 3年 前

青梅新星
帖子: 10

@chris 执行 VACUUM FULL pg_catalog.pg_class; VACUUM FULL pg_catalog.pg_attribut导致的。在官网没找到具体修复方案。

回复
Close Bitnami banner