-
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
Add max_shard_size parameter for Shrink API #5229
Add max_shard_size parameter for Shrink API #5229
Conversation
Signed-off-by: Gao Binlong <[email protected]>
Signed-off-by: Gao Binlong <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Gao Binlong <[email protected]>
120e8fc
to
2bad9ff
Compare
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #5229 +/- ##
============================================
- Coverage 71.02% 70.98% -0.05%
- Complexity 58119 58158 +39
============================================
Files 4711 4711
Lines 277533 277571 +38
Branches 40169 40180 +11
============================================
- Hits 197125 197030 -95
- Misses 64256 64402 +146
+ Partials 16152 16139 -13
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Gradle Check (Jenkins) Run Completed with:
|
server/src/main/java/org/opensearch/action/admin/indices/shrink/ResizeRequest.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java
Show resolved
Hide resolved
server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java
Show resolved
Hide resolved
When this is done, please open a documentation issue to update the docs. Thanks! |
Signed-off-by: Gao Binlong <[email protected]>
@kolchfa-aws, sure, I will do that. |
Signed-off-by: Gao Binlong <[email protected]>
8b7a9d6
to
31f728a
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Gao Binlong <[email protected]>
Signed-off-by: Gao Binlong <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
@reta hi, I've made some change after your last review, can you help to take a look? Thanks. |
server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java
Show resolved
Hide resolved
@gaobinlong could you please create an issue at https://github.com/opensearch-project/documentation-website to document this new parameter for Shrink API, thank 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.
Tiny nit in CHANGELOG, let's keep that clean pls.
Also what's the behavior without max shard size? No limit?
CHANGELOG.md
Outdated
@@ -84,6 +84,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |||
### Added | |||
- Prevent deletion of snapshots that are backing searchable snapshot indexes ([#5069](https://github.com/opensearch-project/OpenSearch/pull/5069)) | |||
|
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.
Delete the new blank line above please.
@@ -702,6 +703,9 @@ private void resizeTest(ResizeType resizeType, CheckedFunction<ResizeRequest, Re | |||
if (resizeType == ResizeType.SPLIT) { | |||
resizeRequest.setSettings(Settings.builder().put("index.number_of_shards", 2).build()); | |||
} | |||
if (resizeType == ResizeType.SHRINK) { |
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.
Nit: add else
CHANGELOG.md
Outdated
@@ -84,6 +84,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |||
### Added | |||
- Prevent deletion of snapshots that are backing searchable snapshot indexes ([#5069](https://github.com/opensearch-project/OpenSearch/pull/5069)) | |||
|
|||
- Add max_shard_size parameter for Shrink API ([#5229](https://github.com/opensearch-project/OpenSearch/pull/5229)) |
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.
Lowercase shrink
@reta I've opened a document issue yet, thanks again for your review. |
Signed-off-by: Gao Binlong <[email protected]>
@dblock thanks for your review, I have made some changes yet. Without |
Gradle Check (Jenkins) Run Completed with:
|
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-5229-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 953a3d6851632c9b09c8dc15dbff02c8aafac6c1
# Push it to GitHub
git push --set-upstream origin backport/backport-5229-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
@gaobinlong Looks like it will need a manual backport to 2.x, thx. |
@dblock ok, I will do it. |
* Add max_shard_size parameter for Shrink API Signed-off-by: Gao Binlong <[email protected]> * add change log Signed-off-by: Gao Binlong <[email protected]> * fix yaml test failed Signed-off-by: Gao Binlong <[email protected]> * optimize the code Signed-off-by: Gao Binlong <[email protected]> * fix test failed Signed-off-by: Gao Binlong <[email protected]> * optimize changelog & code Signed-off-by: Gao Binlong <[email protected]> Signed-off-by: Gao Binlong <[email protected]> (cherry picked from commit 953a3d6)
* Add max_shard_size parameter for Shrink API Signed-off-by: Gao Binlong <[email protected]> * add change log Signed-off-by: Gao Binlong <[email protected]> * fix yaml test failed Signed-off-by: Gao Binlong <[email protected]> * optimize the code Signed-off-by: Gao Binlong <[email protected]> * fix test failed Signed-off-by: Gao Binlong <[email protected]> * optimize changelog & code Signed-off-by: Gao Binlong <[email protected]> Signed-off-by: Gao Binlong <[email protected]> (cherry picked from commit 953a3d6)
Signed-off-by: Gao Binlong [email protected]
Description
As the document mentions that we have a parameter
max_primary_shard_size
, but actually it doesn't exist, and the parameter is used to generate an optimumnumber_of_shards
of the new shrunken index, so it's useful for users. I've implemented the function and changed the parameter's name tomax_shard_size
so that it can be consistent with the similar function inShrink Action
inIndex Management Plugin
.The main changes of this PR are:
max_shard_size
parameter for Shrink API.max_shard_size
parameter for Shrink API in high level rest client.Issues Resolved
#5170
Check List
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.