-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Adding best_compression #49974
Adding best_compression #49974
Conversation
Pinging @elastic/es-core-features (:Core/Features/ILM+SLM) |
c079674
to
5534513
Compare
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.
Thanks for the contribution! I haven't had time to look through it completely (I or @dakrone will do that soon), but it looks like a good take on the problem. However, I did notice an issue with the license headers, as described in the comments.
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CloseIndexStep.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/OpenIndexStep.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexGreenStep.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/CloseIndexStepTest.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/OpenIndexStepTest.java
Outdated
Show resolved
Hide resolved
...ck/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/WaitForIndexGreenStepTest.java
Outdated
Show resolved
Hide resolved
@gwbrown I made the changes as requested. 👍 |
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.
Thanks for working on this @SivagurunathanV! I left some comments
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CloseIndexStep.java
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CloseIndexStep.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CloseIndexStep.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/OpenIndexStep.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexGreenStep.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ForceMergeActionTests.java
Outdated
Show resolved
Hide resolved
if(randomBoolean()) { | ||
maxNumSegments = maxNumSegments + randomIntBetween(1, 10); | ||
} | ||
else { |
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.
Extra newline before this :)
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.
I left comment.
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
@dakrone @jasontedor 👋 Made changes as per the review comments. Please have a look. |
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.
At a high-level, this is looking good to me, thanks for responding to the feedback. I left one comment. Also, missing for me is a documentation update. Can you include that too (e.g., policy-definitions.asciidoc). I didn't do a detailed review of the code, I'll leave that to @dakrone.
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
@jasontedor Applied the |
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.
Thanks for addressing the feedback @SivagurunathanV, I left some more comments.
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ForceMergeActionTests.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ForceMergeActionTests.java
Show resolved
Hide resolved
@@ -492,7 +493,7 @@ private void assertInvalidAction(String phaseName, String currentAction, String. | |||
case DeleteAction.NAME: | |||
return new DeleteAction(); | |||
case ForceMergeAction.NAME: | |||
return new ForceMergeAction(1); | |||
return new ForceMergeAction(1, Codec.getDefault()); |
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.
These should pass null (or have a second constructor so there's no need to specify the codec)
@@ -411,7 +412,7 @@ public void testForceMergeAction() throws Exception { | |||
}; | |||
assertThat(numSegments.get(), greaterThan(1)); | |||
|
|||
createNewSingletonPolicy("warm", new ForceMergeAction(1)); | |||
createNewSingletonPolicy("warm", new ForceMergeAction(1, Codec.getDefault())); |
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.
Can you add an integration test for the best_compression codec here? (in a separate test method)
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.
Thinking of adding codec as parameterized and use this test for best_compression as well. What you think?
Made changes as per review comments. Let me know. Thanks 👍 |
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.
@SivagurunathanV thanks for the updates (sorry about the lag in review due to holidays). I left some more feedback, but it's fairly minor. This is getting close.
CloseIndexRequest request = new CloseIndexRequest(indexMetaData.getIndex().getName()); | ||
getClient().admin().indices() | ||
.close(request, ActionListener.wrap(closeIndexResponse -> { | ||
assert closeIndexResponse.isAcknowledged() : "close index response is not acknowledged"; |
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.
I think rather than an assert, this should throw an exception and go into the ERROR
step
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.
Added Error Step.
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CloseIndexStep.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/OpenIndexStep.java
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexColorStep.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/ForceMergeActionTests.java
Outdated
Show resolved
Hide resolved
...plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/TimeseriesLifecycleTypeTests.java
Outdated
Show resolved
Hide resolved
...lm/qa/multi-node/src/test/java/org/elasticsearch/xpack/ilm/TimeSeriesLifecycleActionsIT.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/WaitForIndexColorStep.java
Show resolved
Hide resolved
@SivagurunathanV I saw you pushed some changes to this branch, should I review it again, or do you want me to wait until you request another review? |
@dakrone Yeah sure, you can review this and let me know if you have any comments. |
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.
We're really close! I left two more comments, thanks for going back and forth on this @SivagurunathanV!
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/CloseIndexStep.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/OpenIndexStep.java
Outdated
Show resolved
Hide resolved
@elasticmachine ok to test |
Added exception handling, struck on the failing tests now. |
PR elastic#50333 has been merged.
DFRSimilarity -> DFR similarity
@dakrone Fixed the broken test. Please review it and let me know. |
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.
This looks good to me now! I left 2 super minor comments (they should be really easy to address), if you want to change those then I will merge this (I'll probably open a separate PR for adding it to the docs unless you want to do that).
Thanks for iterating on this @SivagurunathanV!
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/ForceMergeAction.java
Outdated
Show resolved
Hide resolved
@dakrone Thanks for the feedback. Please review it and let me know. |
This commit adds a `codec` parameter to the ILM `forcemerge` action. When setting the codec to `best_compression` ILM will close the index, then update the codec setting, re-open the index, and finally perform a force merge.
@SivagurunathanV this has been merged, thank you for all your iterations! I'm working on the backport and then I'll update the docs so folks can learn about this. |
Sure, Please let me know if you need any help on this or assign it to me. Thanks |
* Adding best_compression (#49974) This commit adds a `codec` parameter to the ILM `forcemerge` action. When setting the codec to `best_compression` ILM will close the index, then update the codec setting, re-open the index, and finally perform a force merge. * Fix ForceMergeAction toSteps construction (#51825) There was a duplicate force merge step and the test continued to fail. This commit clarifies the `toStep` method and changes the `assertBestCompression` method for better readability. Resolves #51822 * Update version constants Co-authored-by: Sivagurunathan Velayutham <sivadeva.93@gmail.com>
This adds the option to the parameter list and a warning about the index being unavailable during the close and open operations. Relates to elastic#49974
…tic#51819)" This reverts commit 0be61a3.
This adds the option to the parameter list and a warning about the index being unavailable during the close and open operations. Relates to #49974
This adds the option to the parameter list and a warning about the index being unavailable during the close and open operations. Relates to #49974
Best_Compression in ILM policy