ERROR: gp_relation_node (X) has more entries than pg_aocsseg(X) for relation <name of relation> (aocssegfiles.c:1920) in VMware Tanzu Greenplum
search cancel

ERROR: gp_relation_node (X) has more entries than pg_aocsseg(X) for relation <name of relation> (aocssegfiles.c:1920) in VMware Tanzu Greenplum

book

Article ID: 296531

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

This article provides a list of artifacts required to investigate the RCA for "ERROR: gp_relation_node (X) has more entries than pg_aocsseg(X)" in VMware Tanzu Greenplum.

Environment

Product Version: 5.27

Resolution

This checklist can be applied to GPDB versions: 5.x, 6.x.


Note

1. No operations (Truncate, Analyze , Vacuum etc.) are performed after this issue arises, as these operations alter the state of relation and may loose the artifacts needed.

2. Collect SQL artifacts using the "with header" clause for a better reading experience.

For example, copy select oid, relname, reltype from pg_class limit 2 to '/tmp/pg_class.out' with header;.


Artifacts Required

1. Master and affected segment logs (primary and mirror) through gpmt.

2. Transaction Information from Master and affected segment:
select * from gp_transaction_log ;

select * from gp_distributed_log ; 

3. Visible and invisible entries from below queries for the affected database from the master and affected segment:
select xmin, xmax,cmin,cmax,ctid,*  from pg_aoseg.pg_aoseg_<oid>;

select xmin, xmax,cmin,cmax,ctid,*  from pg_aoseg.pg_aocsseg_<oid>;

Select xmin,xmax,cmin,cmax,ctid,* from pg_appendonly;

select * from gp_toolkit.__gp_aocsseg(<oid>); [From master and affected 
segment for AOCO table]

select xmin,xmax,cmin,cmax,ctid,* from gp_relation_node ;

select ctid, * from gp_persistent_relation_node ; [visible only]

select xmin,xmax,cmin,cmax,ctid,oid,* from pg_class ;

select xmin,xmax,cmin,cmax,ctid,* from pg_stat_last_operation;[Master only]

4. Directory lookup from Master and affected Segment(Primary & Mirror):
ls -l base/<database_directory> 

5. Lookup of affected relfilenode (use * to fetch all segment files) from Segment (Primary & Mirror):
ls -l base/<database_directory>/<relfilenode>* 


Note: Make sure a copy of the file or relation exists on your system in case it can not be provided to Tanzu Support before this issue surfaces. This is required to gather information needed to perform a RCA for this issue.