-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing _list/shards API for closed indices #16606
Fixing _list/shards API for closed indices #16606
Conversation
❌ Gradle check result for c62e5f2: 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? |
c62e5f2
to
691803c
Compare
❌ Gradle check result for 691803c: 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: Harsh Garg <[email protected]>
Signed-off-by: Harsh Garg <[email protected]>
Signed-off-by: Harsh Garg <[email protected]>
691803c
to
4663f2b
Compare
Signed-off-by: Harsh Garg <[email protected]>
❕ Gradle check result for 537fb2d: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Signed-off-by: Harsh Garg <[email protected]>
server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsAction.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsAction.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsAction.java
Outdated
Show resolved
Hide resolved
...lClusterTest/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsActionIT.java
Outdated
Show resolved
Hide resolved
...lClusterTest/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsActionIT.java
Show resolved
Hide resolved
...lClusterTest/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsActionIT.java
Show resolved
Hide resolved
...lClusterTest/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsActionIT.java
Outdated
Show resolved
Hide resolved
10d0701
to
77c7c9f
Compare
Signed-off-by: Harsh Garg <[email protected]>
Signed-off-by: Harsh Garg <[email protected]>
77c7c9f
to
152b182
Compare
❌ Gradle check result for 152b182: 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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsAction.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsAction.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Harsh Garg <[email protected]>
Signed-off-by: Harsh Garg <[email protected]>
2b402ec
into
opensearch-project:main
* Fixing _list/shards API for closed indices Signed-off-by: Harsh Garg <[email protected]> (cherry picked from commit 2b402ec) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Fixing _list/shards API for closed indices Signed-off-by: Harsh Garg <[email protected]>
* Fixing _list/shards API for closed indices Signed-off-by: Harsh Garg <[email protected]> Signed-off-by: Mingshi Liu <[email protected]>
* Fixing _list/shards API for closed indices (cherry picked from commit 2b402ec) Signed-off-by: Harsh Garg <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
By default, the Broadcast requests use
IndicesOptions.strictExpandOpenAndForbidClosed()
. For_list/shards
API, concrete indices from strategy are being passed toIndicesStats
Action with the defaultindicesOptions
.Details around
IndexNameExpressionResolver
which are causing issues with the list/shards API:IndicesOptions.strictExpandOpenAndForbidClosed()
, it would result in an error (index_closed_exception)._cat/indices
API, which by default (curl localhost:9200/_cat/indices
), omits the hidden indices but if one of them is explicitly queried, it will return the stats (curl localhost:9200/_cat/indices/hidden-index
)._list/shards API throws index_closed_exception whenever the cluster has closed indices. This change is to resolve and ignore the closed indices from getting explicitly passed to IndicesStatsAction.
Functional Testing
On a local cluster with 2 indices:
open-test-index
-> Open index with 1P and 1R.new-test-idx
-> closed index with 1P and 2 R.Existing
_cat/shards
behaviour:Unfiltered default query outputs closed shards without stats.
Explicitly querying for a concrete closed index, throws error.
Wildcards only match open indices and response is empty if only closed indices match the expression
Fixed
_list/shards
behaviour:Unfiltered default query will output closed shards without stats.
Explicitly querying for a concrete closed index, will output closed shards without stats instead of throwing error.
Wildcards continue to match only open indices and response is empty if only closed indices match the expression
Related Issues
Resolves #16626
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.