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

Adding best_compression #49974

Merged
merged 702 commits into from
Feb 3, 2020
Merged

Adding best_compression #49974

merged 702 commits into from
Feb 3, 2020

Conversation

SivagurunathanV
Copy link
Contributor

@SivagurunathanV SivagurunathanV commented Dec 8, 2019

Best_Compression in ILM policy

@SivagurunathanV SivagurunathanV marked this pull request as ready for review December 8, 2019 22:56
@tvernum tvernum added the :Data Management/ILM+SLM Index and Snapshot lifecycle management label Dec 8, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/ILM+SLM)

Copy link
Contributor

@gwbrown gwbrown left a 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.

@SivagurunathanV
Copy link
Contributor Author

@gwbrown I made the changes as requested. 👍

@gwbrown gwbrown self-requested a review December 10, 2019 04:23
Copy link
Member

@dakrone dakrone left a 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

if(randomBoolean()) {
maxNumSegments = maxNumSegments + randomIntBetween(1, 10);
}
else {
Copy link
Member

Choose a reason for hiding this comment

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

Extra newline before this :)

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

I left comment.

@SivagurunathanV
Copy link
Contributor Author

@dakrone @jasontedor 👋 Made changes as per the review comments. Please have a look.

Copy link
Member

@jasontedor jasontedor left a 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.

@dakrone dakrone self-requested a review December 17, 2019 15:04
@SivagurunathanV
Copy link
Contributor Author

@jasontedor Applied the index_codec change 👍

Copy link
Member

@dakrone dakrone left a 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.

@@ -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());
Copy link
Member

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()));
Copy link
Member

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)

Copy link
Contributor Author

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?

@SivagurunathanV
Copy link
Contributor Author

Made changes as per review comments. Let me know. Thanks 👍

@dakrone dakrone self-requested a review January 2, 2020 23:13
Copy link
Member

@dakrone dakrone left a 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";
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added Error Step.

@dakrone
Copy link
Member

dakrone commented Jan 15, 2020

@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?

@SivagurunathanV
Copy link
Contributor Author

@dakrone Yeah sure, you can review this and let me know if you have any comments.

Copy link
Member

@dakrone dakrone left a 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!

@dakrone
Copy link
Member

dakrone commented Jan 17, 2020

@elasticmachine ok to test

@SivagurunathanV
Copy link
Contributor Author

Added exception handling, struck on the failing tests now.

@SivagurunathanV
Copy link
Contributor Author

@dakrone Fixed the broken test. Please review it and let me know.

Copy link
Member

@dakrone dakrone left a 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!

@SivagurunathanV
Copy link
Contributor Author

@dakrone Thanks for the feedback. Please review it and let me know.

@dakrone dakrone merged commit 763480e into elastic:master Feb 3, 2020
dakrone pushed a commit to dakrone/elasticsearch that referenced this pull request Feb 3, 2020
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.
@dakrone
Copy link
Member

dakrone commented Feb 3, 2020

@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.

@SivagurunathanV
Copy link
Contributor Author

Sure, Please let me know if you need any help on this or assign it to me.

Thanks

dakrone added a commit that referenced this pull request Feb 4, 2020
* 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>
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Feb 4, 2020
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
dakrone added a commit to dakrone/elasticsearch that referenced this pull request Feb 4, 2020
dakrone added a commit that referenced this pull request Feb 5, 2020
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
dakrone added a commit that referenced this pull request Feb 5, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet