Check segment health
check_segment_healthInspect MPP segment posture to detect unhealthy or out-of-sync segments. Returns per-segment status, mode, and role vs preferred_role to identify post-failover state.
Instructions
Walk gp_segment_configuration and surface MPP segment posture. Returns per-segment status ('u' = up), mode ('s' = sync / 'n' = not-in-sync / 'c' = changetracking), and role vs preferred_role to detect post-failover state. Top-level unhealthy_count + out_of_sync_count let agents branch without walking the segments array. Read-only. On vanilla PG returns available=false.
Example: check_segment_health()
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| detail | Yes | ||
| segments | Yes | ||
| available | Yes | ||
| healthy_count | Yes | ||
| total_segments | Yes | ||
| unhealthy_count | Yes | ||
| out_of_sync_count | Yes |