Skip to content
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

Return 409 Conflict HTTP status instead of 503 on failure to concurre… #8986

Merged
merged 4 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Removed blocking wait in TransportGetSnapshotsAction which was exhausting generic threadpool ([#8377](https://github.com/opensearch-project/OpenSearch/pull/8377))
- [Remote Store] Add Segment download stats to remotestore stats API ([#8718](https://github.com/opensearch-project/OpenSearch/pull/8718))
- [Remote Store] Add remote segment transfer stats on NodesStats API ([#9168](https://github.com/opensearch-project/OpenSearch/pull/9168))
- Return 409 Conflict HTTP status instead of 503 on failure to concurrently execute snapshots ([#8986](https://github.com/opensearch-project/OpenSearch/pull/5855))

### Deprecated

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ public ConcurrentSnapshotExecutionException(StreamInput in) throws IOException {

@Override
public RestStatus status() {
return RestStatus.SERVICE_UNAVAILABLE;
return RestStatus.CONFLICT;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import org.opensearch.search.SearchParseException;
import org.opensearch.search.SearchShardTarget;
import org.opensearch.search.internal.ShardSearchContextId;
import org.opensearch.snapshots.ConcurrentSnapshotExecutionException;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.transport.RemoteTransportException;

Expand Down Expand Up @@ -119,6 +120,9 @@ public void testStatus() {

exception = new RemoteTransportException("test", new IllegalStateException("foobar"));
assertThat(exception.status(), equalTo(RestStatus.INTERNAL_SERVER_ERROR));

exception = new ConcurrentSnapshotExecutionException("testRepo", "testSnap", "test");
assertSame(exception.status(), RestStatus.CONFLICT);
}

public void testGuessRootCause() {
Expand Down