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

Partially resolved issue #4687 by changing the improper status code for concurrent snapshot executions #5855

Closed

Conversation

baba-devv
Copy link
Contributor

Signed-off-by: Mani [email protected]

Description

Partially resolved issue #4687 by changing the improper status code for concurrent snapshot execution exception.

Issues Resolved

#4687

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

codecov-commenter commented Jan 13, 2023

Codecov Report

Merging #5855 (fd1572d) into main (a3aab67) will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #5855      +/-   ##
============================================
+ Coverage     71.00%   71.09%   +0.09%     
- Complexity    57166    57248      +82     
============================================
  Files          4763     4763              
  Lines        270003   270003              
  Branches      39508    39508              
============================================
+ Hits         191713   191967     +254     
+ Misses        62139    61866     -273     
- Partials      16151    16170      +19     
Files Changed Coverage Δ
...napshots/ConcurrentSnapshotExecutionException.java 42.85% <100.00%> (+42.85%) ⬆️

... and 498 files with indirect coverage changes

@baba-devv
Copy link
Contributor Author

@Bukhtawar Hi, for issue #4687, should I make a PR by resolving Repository exception status as well ?
Also, any comments on this one ?
cc: @andrross

Comment on lines 60 to 62
public RestStatus status() {
return RestStatus.SERVICE_UNAVAILABLE;
return RestStatus.TOO_MANY_REQUESTS;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks can you please also add a test?

Copy link
Member

@shwetathareja shwetathareja May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering shouldn't this be 409 (Conflict) instead of 429?

Copy link
Member

@dblock dblock May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the underlying error? Is it concurrent snapshots being taken whereas this isn't supported? In that case it should definitely not be a 429, that implies the server is unable to handle traffic, not a predictable conflicting behavior - 409 seems more correct in that case.

"Thrown when a user tries to multiple conflicting snapshot/restore operations at the same time." -> 409

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only question I had was that since it is concurrent & not specifically conflicting, should I change that to 409 ?
@dblock @shwetathareja

Copy link
Member

@shwetathareja shwetathareja May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baba-devv : Since it is concurrent, it is resulting in conflict and hence rejected by server.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baba-devv yes in my opinion it should be 409

vibrantvarun and others added 23 commits July 29, 2023 13:09
…rch-project#8883)

* Updating Version.java from server/ to buildSrc/

Signed-off-by: Varun Jain <[email protected]>

* Adding Changelog

Signed-off-by: Varun Jain <[email protected]>

* Path update

Signed-off-by: Varun Jain <[email protected]>

* Changelog Update

Signed-off-by: Varun Jain <[email protected]>

* Removing Changelog from commit

Signed-off-by: Varun Jain <[email protected]>

---------

Signed-off-by: Varun Jain <[email protected]>
…dex (opensearch-project#8792)

* Add support to restore only unassigned shards of an index

---------

Signed-off-by: Sachin Kale <[email protected]>
Signed-off-by: Sachin Kale <[email protected]>
Co-authored-by: Sachin Kale <[email protected]>
opensearch-project#8901)

* Fix flakiness in MasterServiceTests.testThrottlingForMultipleTaskTypes

The test configured a [timeout duration of zero][1] for certain tasks
and asserted that all tasks were throttled or timed out. This is not a
valid assertion because it is possible for a task to complete before the
[asynchronous timeout operation runs][2], which means the task would
complete successfully. The fix is to adjust the assertion to allow for
successful tasks in this case.

[1]: https://github.com/opensearch-project/OpenSearch/blob/60985bc300d9eafd36c1ab25d46235e1c925c565/server/src/test/java/org/opensearch/cluster/service/MasterServiceTests.java#L941
[2]: https://github.com/opensearch-project/OpenSearch/blob/9fc3f4096958159ec9b53012fc7ced19fd793e1b/server/src/main/java/org/opensearch/common/util/concurrent/PrioritizedOpenSearchThreadPoolExecutor.java#L266

Signed-off-by: Andrew Ross <[email protected]>

* Add a deterministic test case for timeout

Signed-off-by: Andrew Ross <[email protected]>

---------

Signed-off-by: Andrew Ross <[email protected]>
…node replication (opensearch-project#8912)

* Fix SegmentReplicationIT.testReplicahasDiffFilesThanPrimary

This test is now failing for node-node replication. On the primary shard the prepareSegmentReplication method should cancel any ongoing replication if it is running and start a new sync.  Thisis incorrectly using Map.compute which will not replace the existing handler entry in the allocationIdToHandlers map. It will only cancel the existing source handler. As a result this can leave the copyState map with an entry and hold an index commit while the test is cleaning up.  The copyState is only cleared when a handler is cancelled directly or from a cluster state update.

Signed-off-by: Marc Handalian <[email protected]>

* PR feedback.

Signed-off-by: Marc Handalian <[email protected]>

---------

Signed-off-by: Marc Handalian <[email protected]>
The intent of opensearch-project#8825 was to retry only specified tests. The wrong
parameter was configured though: ['filter' should be set][1], not
'classRetry'.

[1]: https://github.com/gradle/test-retry-gradle-plugin/blob/main/README.adoc#filtering

Signed-off-by: Andrew Ross <[email protected]>
…roject#8940)

This commit rote refactors MediaTypeParserRegistry to MediaTypeRegistry
to make the class naming align with the intention of the logic. The
MediaTypeRegistry is a mechanism for downstream extensions to register
concrete MediaTypes thus having Parser in the name is unneeded.

Signed-off-by: Nicholas Walter Knize <[email protected]>
…invocation of segment replication (opensearch-project#8937)

* [Segment Replication] Use deterministic mechanism to have concurrent invocation of segment replication

Signed-off-by: Suraj Singh <[email protected]>

* Clean up

Signed-off-by: Suraj Singh <[email protected]>

---------

Signed-off-by: Suraj Singh <[email protected]>
* Register MediaTypes through SPI

This commit provides a new SPI interface MediaContentProvider. Modules,
Plugins, Extensions, implement this interface and provide the concrete
MediaType implementations (and MIME aliases) through getMediaTypes and
getAdditionalMediaTypes, respectively. This enables downstream
extensions (e.g., serverless or cloud native implementations) to
register their own custom MediaType and define the serialization format
that is registered when the classloader loads the MediaTypeRegistry
instead of having to register the types explicitly in application code.

Signed-off-by: Nicholas Walter Knize <[email protected]>

* pass the MediaTypeProvider classloader to the SPI ServiceLoader

Signed-off-by: Nicholas Walter Knize <[email protected]>

---------

Signed-off-by: Nicholas Walter Knize <[email protected]>
…er (opensearch-project#8967)

* Replace deprecated Query#rewrite(IndexReader with rewrite(IndexSearcher

Query#rewrite(IndexReader reader) is deprecated in Lucene 9.7 and
removed in Lucene 10 in favor of Query#rewrite(IndexSearcher searcher).
The latter provides LeafCollector hooks to optimize for concurrent
queries. This commit cuts over usage of rewrite(IndexReader) to
rewrite(IndexSearcher) for Lucene 10 compatibility and upstream query
optimizations.

Signed-off-by: Nicholas Walter Knize <[email protected]>

* remove stray collector.finish

Signed-off-by: Nicholas Walter Knize <[email protected]>

---------

Signed-off-by: Nicholas Walter Knize <[email protected]>
…erRegistry (opensearch-project#8826)

XContentFactory is tightly coupled to concrete XContentType. This commit
builds on the MediaType abstractions, specifically
MediaTypeParserRegistry, to decouple contentType introspection (e.g.,
determining type from byte streams) from concrete XContentTypes. This
enables downstream extensions (e.g., serverless or cloud native
implementations) to register their own custom XContentType and define
the serialization format for proper content introspection. This also
removes the tight coupling of :libs:opensearch-x-content with abstract
interface contracts further enabling modularity.

Signed-off-by: Nicholas Walter Knize <[email protected]>
…eStorePromotedAsPrimaryCommitCommit (opensearch-project#8931)

Signed-off-by: Poojita Raj <[email protected]>

Return 409 Conflict HTTP status instead of 500 on failure to concurrently execute snapshots

Signed-off-by: Mani <[email protected]>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.http.SearchRestCancellationIT.testAutomaticCancellationDuringFetchPhase

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.repositories.azure.AzureBlobContainerRetriesTests.testReadRangeBlobWithRetries

@andrross
Copy link
Member

andrross commented Aug 3, 2023

Superseded by #8986

@andrross andrross closed this Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.