Consider the following options before rerun the expansion, While there can be more potential discrepancies between
gp_relation_node and
pg_aocsseg- R&D developed a script to detect the damaged AO tables: https://github.com/asimrp/detect_damaged_ao_tables/blob/main/damaged_ao_tables.sql
Example output of this script also shown the segment data directory and aoseg relfilenode:
ao_tablename | gpsegid | ao_oid | aoseg_oid | aoseg_count | pt_count | aoseg_relfilenode | datadir
---------------+---------+--------+-----------+-------------+----------+-------------------+----------------------------------------------------------------------------
co_test | 0 | 16539 | 16544 | 0 | 3 | 16472 | /Users/apraveen/workspace/gpdb5/gpAux/gpdemo/datadirs/dbfast1/demoDataDir0
co_t1 | 0 | 16394 | 16399 | 0 | 3 | 16393 | /Users/apraveen/workspace/gpdb5/gpAux/gpdemo/datadirs/dbfast1/demoDataDir0
ao_t1 | 0 | 16384 | 16389 | 0 | 3 | 16387 | /Users/apraveen/workspace/gpdb5/gpAux/gpdemo/datadirs/dbfast1/demoDataDir0
foo_p_1_prt_8 | 2 | 16698 | 16701 | 0 | 2 | 16542 | /Users/apraveen/workspace/gpdb5/gpAux/gpdemo/datadirs/dbfast3/demoDataDir2
(4 rows)
Note: The script’s output is relevant only if gpcheckcat has reported no issues, and the use of this script should be limited to the cases where select on AO fails with
“gp_relation_node has more/less entries ...” error.
- If a immediate re-run is required, consider run the first phase of
gpexpand with a
"-S" option. This option disables detailed progress reporting. If this option is not specified, detailed progress reporting involves computing size of each existing table using
pg_relation_size() and this step is failing for the damaged table. The command can be something like:
gpexpand -S -i input_file -D database_name
The second phase involves redistribution of data should be able to redistribute the non-damaged tables, and left those damaged ones with the same "gp_relation_node has more entries than ..." error. After the tables are fixed manually, rerun of gpexpand will continue and when no damaged tables remain, the data redistribution (second phase) should finish successfully. The command can be:
gpexpand
or
gpexpand -d duration
You are not likely to encounter the same issue in gp6 as PT has been removed since that.