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

Add more index blocks check for resize APIs (#4845) #6774

Merged
merged 6 commits into from
May 17, 2023

Conversation

gaobinlong
Copy link
Collaborator

@gaobinlong gaobinlong commented Mar 21, 2023

Description

Relates to #4885.
The main change of this PR are:

  1. Add more index blocks check for shrink, split, and clone APIs, returns error in these two situations: 1) throws an illegalArgumentException when user set index.blocks.read_only or index.blocks.metadata to true for the target index explicitly; 2) if the source index's setting index.blocks.read_only is true, and user does not overwrites the setting copied from the source index, throws
    an illegalArgumentException.
  2. Some other tiny change, like remove redundant spaces in the error message and reword the error message to make it clear.
  3. Add unit tests and yaml tests for the code change above.

Issues Resolved

#4885.

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.

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

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.search.SearchWeightedRoutingIT.testSearchAggregationWithNetworkDisruption_FailOpenEnabled
      1 org.opensearch.indices.replication.SegmentReplicationRelocationIT.testRelocateWhileContinuouslyIndexingAndWaitingForRefresh

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@gaobinlong
Copy link
Collaborator Author

Both of the two failed tests are flaky, related issues are #5957 and #6778.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

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

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.cluster.allocation.AwarenessAllocationIT.testThreeZoneOneReplicaWithForceZoneValueAndLoadAwareness

@codecov-commenter
Copy link

codecov-commenter commented Apr 6, 2023

Codecov Report

Merging #6774 (1d27ac4) into main (804bef4) will increase coverage by 0.06%.
The diff coverage is 100.00%.

❗ Current head 1d27ac4 differs from pull request most recent head 8428c85. Consider uploading reports for the commit 8428c85 to get more accurate results

@@             Coverage Diff              @@
##               main    #6774      +/-   ##
============================================
+ Coverage     70.61%   70.67%   +0.06%     
+ Complexity    59794    59536     -258     
============================================
  Files          4896     4862      -34     
  Lines        286899   285553    -1346     
  Branches      41350    41157     -193     
============================================
- Hits         202585   201811     -774     
+ Misses        67633    67086     -547     
+ Partials      16681    16656      -25     
Impacted Files Coverage Δ
...org/opensearch/cluster/metadata/IndexMetadata.java 84.88% <ø> (-0.14%) ⬇️
...rch/action/admin/indices/shrink/ResizeRequest.java 61.81% <100.00%> (+1.24%) ⬆️
...on/admin/indices/shrink/TransportResizeAction.java 65.62% <100.00%> (+1.10%) ⬆️
...h/cluster/metadata/MetadataCreateIndexService.java 79.39% <100.00%> (+0.35%) ⬆️

... and 692 files with indirect coverage changes

@gaobinlong
Copy link
Collaborator Author

gaobinlong commented Apr 19, 2023

@reta, could you help to review this PR? Thank you!

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

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@gaobinlong
Copy link
Collaborator Author

@reta, can this PR be merged now?

@reta reta merged commit 170dcef into opensearch-project:main May 17, 2023
@reta reta added bug Something isn't working backport 2.x Backport to 2.x branch labels May 17, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 17, 2023
* Add more index blocks check for resize APIs (#4845)

Signed-off-by: Gao Binlong <[email protected]>

* modify change log

Signed-off-by: Gao Binlong <[email protected]>

* Rewording the error message

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
(cherry picked from commit 170dcef)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta added a commit that referenced this pull request May 18, 2023
…7601)

* Add more index blocks check for resize APIs (#4845) (#6774)

* Add more index blocks check for resize APIs (#4845)

Signed-off-by: Gao Binlong <[email protected]>

* modify change log

Signed-off-by: Gao Binlong <[email protected]>

* Rewording the error message

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
(cherry picked from commit 170dcef)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Update REST API spec tests version ranges

Signed-off-by: Andriy Redko <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andriy Redko <[email protected]>
stephen-crawford pushed a commit to stephen-crawford/OpenSearch that referenced this pull request May 31, 2023
…opensearch-project#6774)

* Add more index blocks check for resize APIs (opensearch-project#4845)

Signed-off-by: Gao Binlong <[email protected]>

* modify change log

Signed-off-by: Gao Binlong <[email protected]>

* Rewording the error message

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…opensearch-project#6774)

* Add more index blocks check for resize APIs (opensearch-project#4845)

Signed-off-by: Gao Binlong <[email protected]>

* modify change log

Signed-off-by: Gao Binlong <[email protected]>

* Rewording the error message

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
@reta reta mentioned this pull request Jul 17, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants