From 474e637c945019c164fddb04cb56cf6442d440df Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 4 Sep 2024 12:00:24 +0400 Subject: [PATCH] Add unassigned primary shards to health reports (#2851) --- output/openapi/elasticsearch-openapi.json | 21 ++++++- output/schema/schema.json | 59 +++++++++++++++++-- output/typescript/types.ts | 7 +++ specification/cat/health/types.ts | 5 ++ .../cluster/health/ClusterHealthResponse.ts | 2 + specification/cluster/health/types.ts | 2 + 6 files changed, 90 insertions(+), 6 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 2601a7ad5d..81c796e0bd 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -66514,6 +66514,10 @@ "description": "number of initializing nodes", "type": "string" }, + "unassign.pri": { + "description": "number of unassigned primary shards", + "type": "string" + }, "unassign": { "description": "number of unassigned shards", "type": "string" @@ -78043,6 +78047,10 @@ "description": "If false the response returned within the period of time that is specified by the timeout parameter (30s by default)", "type": "boolean" }, + "unassigned_primary_shards": { + "description": "The number of primary shards that are not allocated.", + "type": "number" + }, "unassigned_shards": { "description": "The number of shards that are not allocated.", "type": "number" @@ -78063,6 +78071,7 @@ "status", "task_max_waiting_in_queue_millis", "timed_out", + "unassigned_primary_shards", "unassigned_shards" ] }, @@ -78098,6 +78107,9 @@ }, "unassigned_shards": { "type": "number" + }, + "unassigned_primary_shards": { + "type": "number" } }, "required": [ @@ -78108,7 +78120,8 @@ "number_of_shards", "relocating_shards", "status", - "unassigned_shards" + "unassigned_shards", + "unassigned_primary_shards" ] }, "cluster.health:ShardHealthStats": { @@ -78131,6 +78144,9 @@ }, "unassigned_shards": { "type": "number" + }, + "unassigned_primary_shards": { + "type": "number" } }, "required": [ @@ -78139,7 +78155,8 @@ "primary_active", "relocating_shards", "status", - "unassigned_shards" + "unassigned_shards", + "unassigned_primary_shards" ] }, "_types:ClusterInfoTargets": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 3cbc4dae14..b7d48b2c94 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -89330,6 +89330,23 @@ } } }, + { + "aliases": [ + "up", + "shards.unassigned.primary", + "shardsUnassignedPrimary" + ], + "description": "number of unassigned primary shards", + "name": "unassign.pri", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, { "aliases": [ "u", @@ -89396,7 +89413,7 @@ } } ], - "specLocation": "cat/health/types.ts#L23-L94" + "specLocation": "cat/health/types.ts#L23-L99" }, { "kind": "request", @@ -104595,6 +104612,18 @@ } } }, + { + "description": "The number of primary shards that are not allocated.", + "name": "unassigned_primary_shards", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, { "description": "The number of shards that are not allocated.", "name": "unassigned_shards", @@ -104608,7 +104637,7 @@ } } ], - "specLocation": "cluster/health/ClusterHealthResponse.ts#L39-L72" + "specLocation": "cluster/health/ClusterHealthResponse.ts#L39-L74" }, { "kind": "interface", @@ -104726,9 +104755,20 @@ "namespace": "_types" } } + }, + { + "name": "unassigned_primary_shards", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } } ], - "specLocation": "cluster/health/types.ts#L24-L34" + "specLocation": "cluster/health/types.ts#L24-L35" }, { "kind": "request", @@ -105025,9 +105065,20 @@ "namespace": "_types" } } + }, + { + "name": "unassigned_primary_shards", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } } ], - "specLocation": "cluster/health/types.ts#L36-L43" + "specLocation": "cluster/health/types.ts#L37-L45" }, { "kind": "request", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 3ed53d7b75..7d6d28b4f5 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -6911,6 +6911,10 @@ export interface CatHealthHealthRecord { i?: string 'shards.initializing'?: string shardsInitializing?: string + 'unassign.pri'?: string + up?: string + 'shards.unassigned.primary'?: string + shardsUnassignedPrimary?: string unassign?: string u?: string 'shards.unassigned'?: string @@ -8978,6 +8982,7 @@ export interface ClusterHealthHealthResponseBody { task_max_waiting_in_queue?: Duration task_max_waiting_in_queue_millis: DurationValue timed_out: boolean + unassigned_primary_shards: integer unassigned_shards: integer } @@ -8991,6 +8996,7 @@ export interface ClusterHealthIndexHealthStats { shards?: Record status: HealthStatus unassigned_shards: integer + unassigned_primary_shards: integer } export interface ClusterHealthRequest extends RequestBase { @@ -9017,6 +9023,7 @@ export interface ClusterHealthShardHealthStats { relocating_shards: integer status: HealthStatus unassigned_shards: integer + unassigned_primary_shards: integer } export interface ClusterInfoRequest extends RequestBase { diff --git a/specification/cat/health/types.ts b/specification/cat/health/types.ts index b52159d977..7d867ea5e0 100644 --- a/specification/cat/health/types.ts +++ b/specification/cat/health/types.ts @@ -71,6 +71,11 @@ export class HealthRecord { * @aliases i,shards.initializing,shardsInitializing */ 'init'?: string + /** + * number of unassigned primary shards + * @aliases up,shards.unassigned.primary,shardsUnassignedPrimary + */ + 'unassign.pri'?: string /** * number of unassigned shards * @aliases u,shards.unassigned,shardsUnassigned diff --git a/specification/cluster/health/ClusterHealthResponse.ts b/specification/cluster/health/ClusterHealthResponse.ts index 54ad742b57..80de0b8eab 100644 --- a/specification/cluster/health/ClusterHealthResponse.ts +++ b/specification/cluster/health/ClusterHealthResponse.ts @@ -67,6 +67,8 @@ export class HealthResponseBody { task_max_waiting_in_queue_millis: DurationValue /** If false the response returned within the period of time that is specified by the timeout parameter (30s by default) */ timed_out: boolean + /** The number of primary shards that are not allocated. */ + unassigned_primary_shards: integer /** The number of shards that are not allocated. */ unassigned_shards: integer } diff --git a/specification/cluster/health/types.ts b/specification/cluster/health/types.ts index d93ed4439e..a57213f281 100644 --- a/specification/cluster/health/types.ts +++ b/specification/cluster/health/types.ts @@ -31,6 +31,7 @@ export class IndexHealthStats { shards?: Dictionary status: HealthStatus unassigned_shards: integer + unassigned_primary_shards: integer } export class ShardHealthStats { @@ -40,4 +41,5 @@ export class ShardHealthStats { relocating_shards: integer status: HealthStatus unassigned_shards: integer + unassigned_primary_shards: integer }