gpstate when run on GPDR recovery cluster is not reflecting the actual segment information
search cancel

gpstate when run on GPDR recovery cluster is not reflecting the actual segment information

book

Article ID: 421185

calendar_today

Updated On:

Products

VMware Tanzu Greenplum VMware Tanzu Greenplum / Gemfire VMware Tanzu Data Suite VMware Tanzu Data Suite VMware Tanzu Data Intelligence

Issue/Introduction

When running gpstate on the recovery cluster that was replicated by GPDR, it was not reflecting the actual details, for examples it can show:

1) mirror in down status (though the recovery cluster was not configured with mirrors yet)

2) could not query segment x (<hostname>:<port>) (pointing to the primary cluster segment port)

Environment

GPDB 7.6 + GPDR 1.4

Cause

The reason is that current gpstate version when running on the recovery cluster was still fetching the segment information from primary cluster.

You can check the recovery cluster configuration from /usr/local/gpdr/gpdr_gp_segment_configuration

$ cat /usr/local/gpdr/gpdr_gp_segment_configuration
1 -1 p p n u 7000 localhost localhost /data/master7/gpseg-1
2 0 p p n u 7002 localhost localhost /data/primary7/gpseg0
3 1 p p n u 7003 localhost localhost /data/primary7/gpseg1

However, the recovery cluster was fetching configuration from connecting to template1 and reading catalog table gp_segment_configuration, which was reflecting the primary cluster configuration that could be possibly different, for example:

$ psql -c "select * from gp_segment_configuration" -p 7000
 dbid | content | role | preferred_role | mode | status | port | hostname | address |        datadir
------+---------+------+----------------+------+--------+------+----------+---------+-----------------------
    1 |      -1 | p    | p              | n    | u      | 5437 | data15   | data15  | /data/master7/gpseg-1
    2 |       0 | p    | p              | s    | u      | 6700 | data15   | data15  | /data/primary7/gpseg0
    4 |       0 | m    | m              | s    | u      | 7700 | data15   | data15  | /data/mirror7/gpseg0
    3 |       1 | p    | p              | s    | u      | 6701 | data15   | data15  | /data/primary7/gpseg1
    5 |       1 | m    | m              | s    | u      | 7701 | data15   | data15  | /data/mirror7/gpseg1
(5 rows)

Resolution

The GPDB R&D team is currently working on this to make it as a new feature request, the plan is to make sure that when the Greenplum administrator needs to check the state of the replica cluster (e.g. is it up, is it down, it is healthy) then they can use the standard Greenplum Cluster Management utilities such as gpstate.