-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Opt-in closed/hidden segments in /_cat/segments
#136168
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
base: main
Are you sure you want to change the base?
Opt-in closed/hidden segments in /_cat/segments
#136168
Conversation
Pinging @elastic/es-data-management (Team:Data Management) |
Hi @lukewhiting, I've created a changelog YAML for you. |
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.
Pull Request Overview
This PR adds wildcard expansion capabilities to the /_cat/segments
API to allow targeting closed and hidden indices, bringing it in line with other cat APIs. The main change introduces an allow_closed
parameter that prevents exceptions when targeting closed indices while maintaining backward compatibility.
- Added
expand_wildcards
andallow_closed
parameters to the segments cat API - Updated the API to use
IndicesOptions
for proper wildcard expansion handling - Added comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
RestSegmentsAction.java | Core implementation adding IndicesOptions support and allow_closed capability |
cat.segments.json | REST API specification updates for new parameters |
10_basic.yml | Test coverage for wildcard expansion with closed and hidden indices |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java
Outdated
Show resolved
Hide resolved
8715767
to
2d3f75a
Compare
rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java
Show resolved
Hide resolved
rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/cat.segments/10_basic.yml
Show resolved
Hide resolved
Co-authored-by: Szymon Bialkowski <[email protected]>
…s.json Co-authored-by: Szymon Bialkowski <[email protected]>
/_cat/segments
…kewhiting/elasticsearch into es-5583-shards-cat-additional-options
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!
spec would be nice, and confused about ClusterStateRequest.indices()
but approving so you can merge on your own time without an extra review
…kewhiting/elasticsearch into es-5583-shards-cat-additional-options
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.
nice!
🚢
This PR adds the wildcard expansion options available in other cat API's to allow targeting closed and hidden indices.
It also includes a new flag
allow_closed
that prevents an exception being thrown if targeting a closed index as is the current behaviour. This seemed like the cleanest way to add the new function without breaking BWC.Fixes ES-5583
Fixes #97023