Using gp_toolkit schema view to check Failed Segments

posted Jan 21, 2014, 7:23 AM by Sachchida Ojha   [ updated Jan 21, 2014, 7:24 AM ]
gp_toolkit.gp_pgdatabase_invalid view can be used to check failed segments. 

gpadmin=# \d gp_toolkit.gp_pgdatabase_invalid
View "gp_toolkit.gp_pgdatabase_invalid"
Column | Type | Modifiers
pgdbidbid | smallint |
pgdbiisprimary | boolean |
pgdbicontent | smallint |
pgdbivalid | boolean |
pgdbidefinedprimary | boolean |
View definition:
SELECT gp_pgdatabase.dbid AS pgdbidbid, gp_pgdatabase.isprimary AS pgdbiisprimary, gp_pgdatabase.content AS pgdbicontent, gp_pgdatabase.valid AS pgdbivalid, gp_pgdatabase.definedprimary AS pgdbidefinedprimary
FROM gp_pgdatabase
WHERE NOT gp_pgdatabase.valid
ORDER BY gp_pgdatabase.dbid;

This view shows information about segments that are marked as down in the system catalog. This view is accessible to all users.

pgdbidbid=>The segment dbid. Every segment has a unique dbid.
pgdbiisprimary=>Is the segment currently acting as the primary (active) segment? (t or f)
pgdbicontent=>The content id of this segment. A primary and mirror will have the same content id.
pgdbivalid=>Is this segment up and valid? (t or f)
pgdbidefinedprimary=>Was this segment assigned the role of primary at system initialization time? (t or f)