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

Force Merge should reject requests with only_expunge_deletes and max_num_segments set #44761

Merged
merged 6 commits into from
Jul 26, 2019

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Jul 23, 2019

This pull request changes the ForceMergeRequest.validate() method so that it does not accept the parameters only_expunge_deletes and max_num_segments to be set at the same time.

The motivation is that InternalEngine.forceMerge() just ignores the max. number of segments parameter when the only expunge parameter is set to true, leaving the wrong impression to the user that max. number of segments has been applied. This PR also changes InternalEngine.forceMerge() so that it now throws an exception when both parameters are set, and modifies tests where needed.

Because it changes the behavior of the REST API I marked this as >breaking. Once this is merged I'll open a follow up PR to add deprecation logging in 7.x.

Closes #43102

@tlrx tlrx added >bug >breaking :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. v8.0.0 labels Jul 23, 2019
@tlrx
Copy link
Member Author

tlrx commented Jul 24, 2019

@elasticmachine update branch

@tlrx
Copy link
Member Author

tlrx commented Jul 24, 2019

@elasticmachine run elasticsearch-ci/packaging-sample

@tlrx tlrx requested a review from ywelsch July 24, 2019 12:10
Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,11 @@
[float]
[[breaking_80_indices_changes]]
=== Force Merge API changes
Copy link
Member

Choose a reason for hiding this comment

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

++

@tlrx tlrx merged commit 321c2b8 into elastic:master Jul 26, 2019
@tlrx
Copy link
Member Author

tlrx commented Jul 26, 2019

Thanks @dnhatn !

@tlrx tlrx deleted the force-merge-and-deletes branch July 26, 2019 07:34
jkakavas pushed a commit that referenced this pull request Jul 31, 2019
…ax_num_segments` set (#44761)

This commit changes the ForceMergeRequest.validate() method so that it does 
not accept the parameters only_expunge_deletes and max_num_segments 
to be set at the same time.

The motivation is that InternalEngine.forceMerge() just ignores the max. number 
of segments parameter when the only expunge parameter is set to true, leaving 
the wrong impression to the user that max. number of segments has been applied. 
It also changes InternalEngine.forceMerge() so that it now throws an exception 
when both parameters are set, and modifies tests where needed.

Because it changes the behavior of the REST API I marked this as >breaking. 

Closes #43102
tlrx added a commit that referenced this pull request Aug 6, 2019
This commit adds a deprecation warning in 7.x for the Force Merge API 
when both only_expunge_deletes and max_num_segments are set in a request.

Relates #44761
jrodewig added a commit that referenced this pull request Sep 21, 2021
You can't specify `max_num_segments` and `max_num_segments` in the same request.

Relates to PR #44761.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking >bug :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force merge with only_expunge_deletes does not honour max_num_segments
4 participants