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

Fix test failure after lucene upgrade to 10 #3426

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zane-neo
Copy link
Collaborator

@zane-neo zane-neo commented Jan 23, 2025

Description

After this change: opensearch-project/OpenSearch#16366, the TotalHits's value is been moved to a private field, unable to access it directly outside that class, so removing this to fix the test failure.

We need to change the .value to .value() to make sure the code runs correctly.

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

Signed-off-by: zane-neo <zaniu@amazon.com>
xinyual
xinyual previously approved these changes Jan 23, 2025
Signed-off-by: zane-neo <zaniu@amazon.com>
Signed-off-by: zane-neo <zaniu@amazon.com>
Signed-off-by: zane-neo <zaniu@amazon.com>
@@ -25,7 +25,7 @@ buildscript {
opensearch_build += "-SNAPSHOT"
}

common_utils_version = System.getProperty("common_utils.version", opensearch_build)
Copy link
Member

@peterzhuamazon peterzhuamazon Jan 23, 2025

Choose a reason for hiding this comment

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

This should stay on opensearch_build as it will be switched to 3.0.0.0-alpha1-SNAPSHOT as the version of common-utils.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@peterzhuamazon I didn't see the 3.0.0.0-alpha1-SNAPSHOT available on maven repo: https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/common-utils/, I can't compile success from my local.

Copy link
Member

Choose a reason for hiding this comment

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

it's still failing with opensearch_build for neural as well

Copy link
Member

@peterzhuamazon peterzhuamazon Jan 24, 2025

Choose a reason for hiding this comment

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

That is because Common Utils owner needs to update their plugins 1st to be compatible with lucene10.

@@ -11,8 +11,8 @@ buildscript {
ext {
opensearch_group = "org.opensearch"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
opensearch_version = System.getProperty("opensearch.version", "3.0.0-alpha1-SNAPSHOT")
Copy link
Member

Choose a reason for hiding this comment

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

This is correct.

@@ -56,7 +56,7 @@ dependencies {
implementation group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}"
implementation "org.opensearch.client:opensearch-rest-client:${opensearch_version}"
// Multi-tenant SDK Client
implementation "org.opensearch:opensearch-remote-metadata-sdk:${opensearch_build}"
implementation "org.opensearch:opensearch-remote-metadata-sdk:3.0.0-SNAPSHOT"
Copy link
Member

Choose a reason for hiding this comment

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

Remote sdk should also be 3.0.0.0-alpha1-SNAPSHOT.

@dbwiddis

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Remote sdk should also be 3.0.0.0-alpha1-SNAPSHOT.

We are still making changes on that for 2.19.0. I do not plan on updating to alpha until after at least code freeze date.

If anyone wants to get ahead of the game they are welcome to check out that repo and publish it locally with alpha1. All this churn as we're trying to finish up features within the week is causing a lot of wasted effort and delays.

Copy link
Contributor

@pyek-bot pyek-bot left a comment

Choose a reason for hiding this comment

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

changes for lucene upgrade (TotalHits) looks good

@martin-gaievski
Copy link
Member

martin-gaievski commented Jan 23, 2025

@zane-neo why merging directly to main? I think the strategy that core took is more flexible (2 branches, main is pointing to lucene 9.12 and new branch, 3.0.0-alpha or whatever is pointing to core 3.0.0-alpha1 and lucene 10.1). Ml-commons is consumed by multiple other plugins, so to keep all version variables in gradle consistent we all need to follow same pattern in all plugins.

cc: @minalsha

@dhrubo-os
Copy link
Collaborator

@zane-neo why merging directly to main? I think the strategy that core took is more flexible (2 branches, main is pointing to lucene 9.12 and new branch, 3.0.0-alpha or whatever is pointing to core 3.0.0-alpha1 and lucene 10.1). Ml-commons is consumed by multiple other plugins, so to keep all version variables in gradle consistent we all need to follow same pattern in all plugins.

cc: @minalsha

+1

@ylwu-amzn
Copy link
Collaborator

@zane-neo why merging directly to main? I think the strategy that core took is more flexible (2 branches, main is pointing to lucene 9.12 and new branch, 3.0.0-alpha or whatever is pointing to core 3.0.0-alpha1 and lucene 10.1). Ml-commons is consumed by multiple other plugins, so to keep all version variables in gradle consistent we all need to follow same pattern in all plugins.

cc: @minalsha

Sounds reasonable, let's use same strategy of core ?

@peterzhuamazon
Copy link
Member

In core, main is lucene10 and will publish snapshots in 3.0.0-alpha1-SNAPSHOT.

3.0.0-before-alpha1 is a locked branch with lucene9 and we will not build that branch anymore, the last build is to cleanup and restore 3.0.0-SNAPSHOT.

@martin-gaievski
Copy link
Member

In core, main is lucene10 and will publish snapshots in 3.0.0-alpha1-SNAPSHOT.

3.0.0-before-alpha1 is a locked branch with lucene9 and we will not build that branch anymore, the last build is to cleanup and restore 3.0.0-SNAPSHOT.

got it, I understood it's the other way around. To follow core strategy we need to adopt lucene in main plugin branches, this PR is correct

@dhrubo-os
Copy link
Collaborator

In core, main is lucene10 and will publish snapshots in 3.0.0-alpha1-SNAPSHOT.
3.0.0-before-alpha1 is a locked branch with lucene9 and we will not build that branch anymore, the last build is to cleanup and restore 3.0.0-SNAPSHOT.

got it, I understood it's the other way around. To follow core strategy we need to adopt lucene in main plugin branches, this PR is correct

But we shouldn't merge this PR now. After 2.19 release, we can merge this PR.

According to @andrross

Once you update to consume 3.0.0-alpha1-SNAPSHOT then you'll have to fix the breaking changes from Lucene on your main branch. Those changes cannot be backported to 2.x. If you're busy working towards 2.19 in the short term you can postpone updating to the alpha version.

@andrross
Copy link
Member

In core, main is lucene10 and will publish snapshots in 3.0.0-alpha1-SNAPSHOT.
3.0.0-before-alpha1 is a locked branch with lucene9 and we will not build that branch anymore, the last build is to cleanup and restore 3.0.0-SNAPSHOT.

got it, I understood it's the other way around. To follow core strategy we need to adopt lucene in main plugin branches, this PR is correct

But we shouldn't merge this PR now. After 2.19 release, we can merge this PR.

According to @andrross

Once you update to consume 3.0.0-alpha1-SNAPSHOT then you'll have to fix the breaking changes from Lucene on your main branch. Those changes cannot be backported to 2.x. If you're busy working towards 2.19 in the short term you can postpone updating to the alpha version.

To be clear, you don’t have to wait until after 2.19, but you do have that option if that makes things easier.

@zane-neo
Copy link
Collaborator Author

In core, main is lucene10 and will publish snapshots in 3.0.0-alpha1-SNAPSHOT.
3.0.0-before-alpha1 is a locked branch with lucene9 and we will not build that branch anymore, the last build is to cleanup and restore 3.0.0-SNAPSHOT.

got it, I understood it's the other way around. To follow core strategy we need to adopt lucene in main plugin branches, this PR is correct

But we shouldn't merge this PR now. After 2.19 release, we can merge this PR.
According to @andrross

Once you update to consume 3.0.0-alpha1-SNAPSHOT then you'll have to fix the breaking changes from Lucene on your main branch. Those changes cannot be backported to 2.x. If you're busy working towards 2.19 in the short term you can postpone updating to the alpha version.

To be clear, you don’t have to wait until after 2.19, but you do have that option if that makes things easier.

Yeah, we can merge this main but not backport it.

@dhrubo-os
Copy link
Collaborator

In core, main is lucene10 and will publish snapshots in 3.0.0-alpha1-SNAPSHOT.
3.0.0-before-alpha1 is a locked branch with lucene9 and we will not build that branch anymore, the last build is to cleanup and restore 3.0.0-SNAPSHOT.

got it, I understood it's the other way around. To follow core strategy we need to adopt lucene in main plugin branches, this PR is correct

But we shouldn't merge this PR now. After 2.19 release, we can merge this PR.
According to @andrross

Once you update to consume 3.0.0-alpha1-SNAPSHOT then you'll have to fix the breaking changes from Lucene on your main branch. Those changes cannot be backported to 2.x. If you're busy working towards 2.19 in the short term you can postpone updating to the alpha version.

To be clear, you don’t have to wait until after 2.19, but you do have that option if that makes things easier.

Yeah, we can merge this main but not backport it.

Agree, but let's merge this after 2.19 release as we are planning to raise few more PRs for 2.19 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants