Skip to content

Conversation

@karenyrx
Copy link
Contributor

@karenyrx karenyrx commented Aug 6, 2025

Description

Used in conjunction with opensearch-project/OpenSearch#18949

Related Issues

Part of #2816
Related to opensearch-project/OpenSearch#18513

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.

@karenyrx karenyrx force-pushed the knnpr3 branch 2 times, most recently from 10164f8 to a6be98f Compare August 11, 2025 17:01
@karenyrx
Copy link
Contributor Author

Hi @navneet1v @shatejas @finnroblin, the CI failure seems unrelated to this PR, as I didn't chnage any of the files related to CMake or JNI. Could you share any insights on how this could be fixed? Thanks!

CMake Error at external/nmslib/similarity_search/CMakeLists.txt:73 (message):

  Unrecognized compiler (use GCC, Clang, Intel compiler, or MSVC (on
> Task :cmakeJniLib FAILED
  Windows)!

@finnroblin
Copy link
Contributor

finnroblin commented Sep 12, 2025

Hi @peterzhuamazon , do you know why the MacOS build would fail (with no changes to C++/JNI that would break the compilation)? Has any infrastructure changed recently on the MacOS CI runners? Compilation is working for me locally on MacOS 15.3.2 with both JDK 21 and JDK 24. Thanks

Copy link
Contributor

@finnroblin finnroblin left a comment

Choose a reason for hiding this comment

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

LGTM

@finnroblin finnroblin mentioned this pull request Sep 15, 2025
5 tasks
Copy link
Collaborator

@Vikasht34 Vikasht34 left a comment

Choose a reason for hiding this comment

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

Can we have complete unit test and if possible unit test for this PR?

@navneet1v
Copy link
Collaborator

@karenyrx can you please resolve the comments and get this PR in good shape. The KNN build is failing without this change

@karenyrx
Copy link
Contributor Author

Can we have complete unit test and if possible unit test for this PR?

A good test is that that previous unit tests continue to pass (as this is mostly a refactor), but added some new ones as well to cover more edge cases

@navneet1v
Copy link
Collaborator

@karenyrx I have created an issue for mac os Fix: #2876.

Lets resolve all the comments and then merge this code since the builds are blocked.

Signed-off-by: karenx <[email protected]>
@navneet1v
Copy link
Collaborator

@karenyrx the CIs are failing

Copy link
Collaborator

@navneet1v navneet1v left a comment

Choose a reason for hiding this comment

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

Approving the code, since CI is only left. Overall code looks good to me.

@navneet1v
Copy link
Collaborator

@Vikasht34 can you please review this PR now, this PR needs to be merged since this is blocking the builds.

Copy link
Collaborator

@Vikasht34 Vikasht34 left a comment

Choose a reason for hiding this comment

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

LGTM

@navneet1v navneet1v merged commit ba97971 into opensearch-project:main Sep 17, 2025
35 of 37 checks passed
@bzhangam
Copy link
Contributor

@karenyrx @finnroblin @Vikasht34 @navneet1v After this PR is merged we can run into new issues(test):

> Could not resolve all files for configuration ':testFixturesCompileClasspath'.
   > Could not resolve com.google.errorprone:error_prone_annotations:2.26.1.
     Required by:
         root project : > com.google.guava:guava:33.2.1-jre
      > Conflict found for module 'com.google.errorprone:error_prone_annotations': between versions 2.41.0 and 2.26.1
> There is 1 more failure with an identical cause.

I have tried to do below to fix it in this PR and seems like it can pass the github checks.

    // com.google.guava:guava:33.2.1-jre is using com.google.errorprone:error_prone_annotations:2.26.1 but OpenSearch
    // core is using 2.41.0 so manually force to use 2.41.0 to avoid the conflict.
    testFixturesImplementation('com.google.guava:guava:33.2.1-jre'){
        exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
    }
    testFixturesImplementation group: 'com.google.errorprone', name: 'error_prone_annotations', version: '2.41.0'

But when I start the cluster locally and try to test the knn query it will fail with error:

» java.lang.NoClassDefFoundError: com/google/common/util/concurrent/internal/InternalFutureFailureAccess » at java.base/java.lang.ClassLoader.defineClass1(Native Method) » at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)

Which seems related to the change about

   compileOnly("org.opensearch.plugin:transport-grpc:${opensearch_version}") {
        exclude group: 'com.google.guava', module: 'guava'
        exclude group: 'com.google.guava', module: 'failureaccess'
        exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
    }

Could you help take a look?

@karenyrx
Copy link
Contributor Author

karenyrx commented Sep 18, 2025

@karenyrx
Copy link
Contributor Author

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.

5 participants