-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Removed NOT_FOUND for empty results. #6544
Changes from all commits
dc2ffc9
2d2a705
bd33545
f5ce3df
137cae6
8464bed
b9fd886
26f1df5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
import java.util.List; | ||
|
||
import static org.opensearch.core.xcontent.ConstructingObjectParser.constructorArg; | ||
import static org.opensearch.rest.RestStatus.NOT_FOUND; | ||
import static org.opensearch.rest.RestStatus.OK; | ||
|
||
/** | ||
|
@@ -57,7 +56,6 @@ public List<DeletePitInfo> getDeletePitResults() { | |
*/ | ||
@Override | ||
public RestStatus status() { | ||
if (deletePitResults.isEmpty()) return NOT_FOUND; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what would be the payload returned from the method? Empty list of PITs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The server returns 200 StatusCode with { "pits": [] } as the body when there are no PITs to delete. |
||
return OK; | ||
} | ||
|
||
|
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.
Does this change the behavior of deleting a single PIT or a list of PITs? Should there be a test for those cases as well?
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.
@andrross I don't think it will result in any change in the behaviour of deleting a single PIT or a list of PITs using
DELETE localhost:9200/_search/point_in_time/
API.Request Delete PIT with empty array results in validation exception.
DELETE localhost:9200/_search/point_in_time/
Request Body
Response
Request with incorrect pits results in failure with failure message associated with every pit id
DELETE localhost:9200/_search/point_in_time/
Request Body
Response
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.
@andrross
Should there be a test for those cases as well?
Few tests cases already exist for the DELETE PIT(s). But I couldn't find test case for the use case where empty pit array is passed in the body.
I believe this should be tracked through a separate issue.