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

Update merge on refresh and merge on commit defaults in Opensearch (Lucene 9.3) #3561

Merged
merged 2 commits into from
Jul 26, 2022

Conversation

reta
Copy link
Collaborator

@reta reta commented Jun 10, 2022

Signed-off-by: Andriy Redko andriy.redko@aiven.io

Description

The Apache Lucene 9.3 made merge-on-refresh enabled by default [1], [2]. The OpenSearch merge on refresh and merge on commit defaults have to be updated in order to accommodate this change.

Additional context, the merge-on-refresh is now fully implemented by MergePolicy. Some merge polices (like TieredMergePolicy and LogMergePolicy) already benefit from this right away, but for others the wrapping merge policy (like
MergeOnFlushMergePolicy) still has (or could) to be applied. This pull request acknowledged the merge-on-refresh as default and also allows to disable it or supply the merge policy to be used.

[1] apache/lucene#921
[2] apache/lucene#935

Issues Resolved

Closes #3553

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

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.

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure a32befcdc868023d73566a56ce7d4c6077ff6e0d
Log 5898

Reports 5898

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 387ee14c2e2d0b68752ae72a35ee85247a410390
Log 5899

Reports 5899

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 32ae3b1908d519e255b83f0c348a8442ff60f38a
Log 5901

Reports 5901

@reta
Copy link
Collaborator Author

reta commented Jun 11, 2022

start gradle check

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 32ae3b1908d519e255b83f0c348a8442ff60f38a
Log 5904

Reports 5904

@reta
Copy link
Collaborator Author

reta commented Jun 11, 2022

start gradle check

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 32ae3b1908d519e255b83f0c348a8442ff60f38a
Log 5907

Reports 5907

@reta
Copy link
Collaborator Author

reta commented Jun 13, 2022

start gradle check

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 32ae3b1908d519e255b83f0c348a8442ff60f38a
Log 5938

Reports 5938

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure d592c66312e86fcaaae27c17b3420fe9c2ab52fc
Log 5939

Reports 5939

@reta reta force-pushed the issue-3553 branch 3 times, most recently from a3a3553 to 6837d1b Compare June 13, 2022 18:12
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 941fe47335cfb16d0375b3acb933c702d4d8a7f2
Log 5941

Reports 5941

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure a3a355339ef093356afee7acf39ec1fbe8b1ebd1
Log 5942

Reports 5942

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 6837d1bb076a4eff4fbba2682b5a4b31a540b1a2
Log 5943

Reports 5943

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure d8cfd01d8b2d4a7b93f5da1eb34520d19b316f93
Log 5945

Reports 5945

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 6c33cb70bd11084133984dcb206009a51284e09b
Log 5947

Reports 5947

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success aac0ad7188301f1891caadfa8a44538e5638e673
Log 5978

Reports 5978

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 43d03ee329d25bdc90ef815497645e96f13f8234
Log 5986

Reports 5986

@reta reta marked this pull request as ready for review June 14, 2022 17:10
@reta reta requested a review from a team as a code owner June 14, 2022 17:10
@reta reta added the backport 2.x Backport to 2.x branch label Jun 27, 2022
Copy link
Collaborator

@nknize nknize left a comment

Choose a reason for hiding this comment

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

Looking pretty good. Just a general question on whether or not we want to switch away from a boolean setting to using a policy name.

@@ -574,7 +573,7 @@ public void testMergeSegmentsOnCommit() throws Exception {
final Settings.Builder settings = Settings.builder()
.put(defaultSettings.getSettings())
.put(IndexSettings.INDEX_MERGE_ON_FLUSH_MAX_FULL_FLUSH_MERGE_WAIT_TIME.getKey(), TimeValue.timeValueMillis(5000))
.put(IndexSettings.INDEX_MERGE_ON_FLUSH_ENABLED.getKey(), true);
.put(IndexSettings.INDEX_MERGE_ON_FLUSH_POLICY.getKey(), "merge-on-flush");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to switch away from a boolean here at this point? I'm not sure we expect any merge on flush policy variations other than the default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nknize the INDEX_MERGE_ON_FLUSH_POLICY is a new setting (semantics of INDEX_MERGE_ON_FLUSH_ENABLED is kept as boolean). The reason for that is that not every policy may implement merge-on-flush/commit but the composite one could be used for this reasons.

@reta reta force-pushed the issue-3553 branch 2 times, most recently from 1abf3f6 to 913868d Compare June 29, 2022 18:14
@reta
Copy link
Collaborator Author

reta commented Jul 4, 2022

@nknize may I ask you please to take a second look? Thank you!

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2022

Gradle Check (Jenkins) Run Completed with:

  • RESULT: null ❌
  • URL: null
  • CommitID: 91d67c7547f2c2d4517b9be4091c6d2700c750fc

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2022

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Collaborator Author

reta commented Jul 12, 2022

@nknize may I ask you please to take a second look? Thank you!

reta added 2 commits July 25, 2022 12:12
…ucene 9.3)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
@reta
Copy link
Collaborator Author

reta commented Jul 25, 2022

@dblock @dblock @Bukhtawar sorry guys, may I ask for your help here? sadly cannot get back @nknize attention on this change .... thank you!

@nknize
Copy link
Collaborator

nknize commented Jul 25, 2022

@dblock @dblock @Bukhtawar sorry guys, may I ask for your help here? sadly cannot get back @nknize attention on this change .... thank you!

Hey @reta sorry about that! I had gh status set to away while I was out and it suppressed my notifications so I missed the ping. Will check it here shortly.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Copy link
Collaborator

@nknize nknize 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 doing this@reta!

@reta
Copy link
Collaborator Author

reta commented Jul 25, 2022

Thanks for doing this@reta!

Thanks a lot for review @nknize, really appreciate it !

@reta reta merged commit a34a4c0 into opensearch-project:main Jul 26, 2022
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

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
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-3561-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a34a4c04250b5c4c210ce79d14611953f5267963
# Push it to GitHub
git push --set-upstream origin backport/backport-3561-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-3561-to-2.x.

reta added a commit to reta/OpenSearch that referenced this pull request Jul 26, 2022
…ucene 9.3) (opensearch-project#3561)

* Update merge on refresh and merge on commit defaults in Opensearch (Lucene 9.3)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Addressing code review comments, adding more tests

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit a34a4c0)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
andrross pushed a commit that referenced this pull request Jul 26, 2022
…ucene 9.3) (#3561) (#4013)

* Update merge on refresh and merge on commit defaults in Opensearch (Lucene 9.3)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Addressing code review comments, adding more tests

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit a34a4c0)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
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 v2.2.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update merge on refresh and merge on commit defaults in Opensearch (Lucene 9.3)
4 participants