elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.68k stars 24.66k forks source link

Cluster Health API: return RED when <target> does not exist #89980

Open inqueue opened 2 years ago

inqueue commented 2 years ago

Elasticsearch Version

8.4.1

Installed Plugins

No response

Java Version

bundled

OS Version

ESS

Problem Description

The Cluster Health API should return status: red when the request is against a non-existent target; i.e., when the target index does not exist, as described in https://github.com/elastic/elasticsearch/issues/781.

Steps to Reproduce

GET /_cluster/health/not_an_index_here-*?wait_for_status=green&level=indices

{
  "cluster_name": "7bee60df4c35441c844e24fb01a54d73",
  "status": "green",
  "timed_out": false,
  "number_of_nodes": 1,
  "number_of_data_nodes": 1,
  "active_primary_shards": 0,
  "active_shards": 0,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 0,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 100.0,
  "indices": {}
}

Logs (if relevant)

No response

elasticsearchmachine commented 2 years ago

Pinging @elastic/es-data-management (Team:Data Management)

andrew-waite commented 2 years ago

@inqueue

Hi there,

I was wondering if anyone else was already working on this issue?

If not I would like to take a stab at it.

inqueue commented 1 year ago

Hi @andrew-waite, there is no working effort on this issue to my knowledge. @elastic/es-data-management may know.