Skip to content

Return 404 for missing indices in cluster health API instead of RED w…#19201

Open
ogprakash wants to merge 1 commit into
opensearch-project:mainfrom
ogprakash:bugfix/cluster-health-404
Open

Return 404 for missing indices in cluster health API instead of RED w…#19201
ogprakash wants to merge 1 commit into
opensearch-project:mainfrom
ogprakash:bugfix/cluster-health-404

Conversation

@ogprakash
Copy link
Copy Markdown

@ogprakash ogprakash commented Sep 1, 2025

Description

This PR Changes the behaviour of the cluster health API when a non-existing-index is requested.
Previously, the API would wait until timeout and returns RED status of cluster
With this change, the API now immediately throws IndexNotFoundException, which maps to HTTP 404.

Related Issues

Resolves #19022

Check List

  • Functionality includes testing.
    • Updated ClusterHealthIT to expect IndexNotFoundException instead of RED for missing indices.
    • Updated/added unit tests in ClusterStateHealthTests to validate immediate 404 behavior.
  • API changes companion pull request created, if applicable. (N/A, no REST spec change)
  • Public documentation issue/PR created, if applicable. (Can be added if maintainers request doc update)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ogprakash ogprakash requested a review from a team as a code owner September 1, 2025 16:33
@github-actions github-actions Bot added bug Something isn't working Other labels Sep 1, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 1, 2025

❌ Gradle check result for 54fc3a9: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@ogprakash ogprakash force-pushed the bugfix/cluster-health-404 branch from 54fc3a9 to 7f3bbfd Compare September 1, 2025 17:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 1, 2025

❌ Gradle check result for 7f3bbfd: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 1aa79bc: null

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@ogprakash ogprakash force-pushed the bugfix/cluster-health-404 branch from 1aa79bc to e99d0eb Compare September 15, 2025 01:32
@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for e99d0eb: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@ogprakash ogprakash force-pushed the bugfix/cluster-health-404 branch from e99d0eb to 942fd81 Compare September 15, 2025 01:47
@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 942fd81: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Prakash Bhardwaj <bhardwajprakash653@gmail.com>
@ogprakash ogprakash force-pushed the bugfix/cluster-health-404 branch from 942fd81 to 637e990 Compare September 15, 2025 02:03
@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 637e990: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot Bot added the stalled Issues that have stalled label Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Other stalled Issues that have stalled

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 408 response with incorrect information returned from GET _cluster/health/<index> given nonexistent index

1 participant