gpstate -e is showing warning "could not query segment"
search cancel

gpstate -e is showing warning "could not query segment"

book

Article ID: 295268

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

In below example of a testing lab, the gpstate -e shows the warning message that it could not query the segment 2 and 3 on the host gpss_single, but all these segments are UP and working well actually:
[gpadmin@gpss_single]$ gpstate -e
20230601:07:23:59:083546 gpstate:gpss_single:gpadmin-[INFO]:-Starting gpstate with args: -e
20230601:07:23:59:083546 gpstate:gpss_single:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 6.24.3 build commit:25d3498a400ca5230e81abb94861f23389315213'
20230601:07:23:59:083546 gpstate:gpss_single:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 9.4.26 (Greenplum Database 6.24.3 build commit:25d3498a400ca5230e81abb94861f23389315213) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on May  3 2023 20:34:57'
20230601:07:23:59:083546 gpstate:gpss_single:gpadmin-[INFO]:-Obtaining Segment details from master...
20230601:07:23:59:083546 gpstate:gpss_single:gpadmin-[INFO]:-Gathering data from segments...
20230601:07:24:00:083546 gpstate:gpss_single:gpadmin-[WARNING]:-could not query segment 2 (gpss_single:6000)
20230601:07:24:00:083546 gpstate:gpss_single:gpadmin-[WARNING]:-could not query segment 3 (gpss_single:6001)
20230601:07:24:00:083546 gpstate:gpss_single:gpadmin-[INFO]:-----------------------------------------------------
20230601:07:24:00:083546 gpstate:gpss_single:gpadmin-[INFO]:-Segment Mirroring Status Report
20230601:07:24:00:083546 gpstate:gpss_single:gpadmin-[WARNING]:-could not query segment 2 (gpss_single:6000)
20230601:07:24:00:083546 gpstate:gpss_single:gpadmin-[WARNING]:-could not query segment 3 (gpss_single:6001)
20230601:07:24:00:083546 gpstate:gpss_single:gpadmin-[INFO]:----------------------------------------------------- 


Resolution

In most cases, the cause should be the missing entry in /etc/hosts for the host where the segments reside. Solution is to add the entry like:
192.168.1.76 gpss_single 
Then run again gpstate -e to check if the result gets normal.