Pivotal Knowledge Base

Follow

gpstate Warning "Greenplum current version = Unknown"

Environment

Pivotal Greenplum Database all versions

Symptom

The following Warning message can be seen when gpstate -s runs

$ gpstate -s
20170927:11:30:49:023908 gpstate:master:gpadmin-[INFO]:-Starting gpstate with args: -s
20170927:11:30:49:023908 gpstate:master:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.3.4.2 build 1'
20170927:11:30:49:023908 gpstate:master:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.2.15 (Greenplum Database 4.3.4.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Mar 20 2015 10:46:30'
20170927:11:30:49:023908 gpstate:master:gpadmin-[INFO]:-Obtaining Segment details from master...
20170927:11:30:49:023908 gpstate:master:gpadmin-[INFO]:-Gathering data from segments...
...
20170927:11:30:52:023908 gpstate:master:gpadmin-[INFO]:-----------------------------------------------------
20170927:11:30:52:023908 gpstate:master:gpadmin-[INFO]:--Master Configuration & Status
20170927:11:30:52:023908 gpstate:master:gpadmin-[INFO]:-----------------------------------------------------
20170927:11:30:52:023908 gpstate:master:gpadmin-[INFO]:- Master host = master
20170927:11:30:52:023908 gpstate:master:gpadmin-[INFO]:- Master postgres process ID = 32291
20170927:11:30:52:023908 gpstate:master:gpadmin-[INFO]:- Master data directory = /gpdata/master/gpseg-1
20170927:11:30:52:023908 gpstate:master:gpadmin-[INFO]:- Master port = 5555
20170927:11:30:52:023908 gpstate:master:gpadmin-[INFO]:- Master current role = dispatch
20170927:11:30:52:023908 gpstate:master:gpadmin-[INFO]:- Greenplum initsystem version = 4.3.4.2 build 1
20170927:11:30:52:023908 gpstate:master:gpadmin-[WARNING]:-Greenplum current version = Unknown <<<<<<<<

or similar output with gpstate -i

$ gpstate -i
20170927:11:31:25:027455 gpstate:master:gpadmin-[INFO]:-Starting gpstate with args: -i
20170927:11:31:25:027455 gpstate:master:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.3.4.2 build 1'
20170927:11:31:25:027455 gpstate:master:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.2.15 (Greenplum Database 4.3.4.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Mar 20 2015 10:46:30'
20170927:11:31:25:027455 gpstate:master:gpadmin-[INFO]:-Obtaining Segment details from master...
20170927:11:31:25:027455 gpstate:master:gpadmin-[INFO]:-Loading version information
..
20170927:11:31:27:027455 gpstate:master:gpadmin-[INFO]:- Host Datadir Port Version
20170927:11:31:27:027455 gpstate:master:gpadmin-[WARNING]:-master /gpdata/master/gpseg-1 5555 unable to retrieve version <<<<<<<<

Cause

Running gpstate with verbose output (-v flag) shows the following, that leads to the unable to retrieve version message.

20170927:15:03:31:014152 gpgetstatususingtransition.py_master:gpadmin:master:gpadmin-[DEBUG]:-postmaster_pid_exists: True tmpfile_exists: False lockfile_exists: False netstat port: True  pid: 32291
20170927:15:03:31:014152 gpgetstatususingtransition.py_master:gpadmin:master:gpadmin-[WARNING]:-Error getting data from segment /gpdata/master/gpseg-1; it is not running

It can be seen above that the variable lockfile_exists=false, this makes the gpgetstatususingtransition.py routine think that the database is not running in that server, and the version check is never done. Details can be seen in the code snippet taken from the Greenplum Database gpstate code:

if currentPMPidData is not None and (currentPMPidData['pidValue'] == 0 or not currentPMPidData['lockFileExists'] or not currentPMPidData['netstatPortActive']):
    logger.warn("Error getting data from segment %s; it is not running" % seg.getSegmentDataDirectory())
    return None

Resolution

The most common scenario that leads to this is, the Greenplum lock file has been manually removed from /tmp at some point, maybe as a mistake in a routine /tmp cleanup. This lock file has the syntax, .s.PGSQL..lock. If this is indeed the case, a database restart should re-create this file and fix the gpstate output.

Comments

Powered by Zendesk