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

SOLR-15733: Separate out a solrj-streaming module #1099

Merged
merged 15 commits into from
Nov 1, 2022

Conversation

joel-bernstein
Copy link
Contributor

@joel-bernstein joel-bernstein commented Oct 21, 2022

@joel-bernstein joel-bernstein marked this pull request as draft October 21, 2022 15:41
@joel-bernstein
Copy link
Contributor Author

First step of migrating Streaming Expressions to solrj-streaming.

@joel-bernstein
Copy link
Contributor Author

joel-bernstein commented Oct 21, 2022

The latest commit allows Solr to assemble and build the new solrj-streaming jar. The distribution starts and streaming expressions run. So it's getting closer. Next I'll dig into the tests.

solr/solrj/build.gradle Show resolved Hide resolved
solr/solrj-streaming/build.gradle Outdated Show resolved Hide resolved
solr/solrj-streaming/build.gradle Outdated Show resolved Hide resolved
@joel-bernstein
Copy link
Contributor Author

joel-bernstein commented Oct 21, 2022

solrj-streaming tests are passing now. Checking the entire test suite, there will be failures in places that expect to find Streaming Expressions in solrj.

@joel-bernstein
Copy link
Contributor Author

The full test suit is passing except for the following which fails everytime and seems to be unrelated.

2> 32414 INFO (TEST-PerReplicaStatesIntegrationTest.testPerReplicaStateCollection-seed#[D7017DB2FFB75346]) [] o.a.s.SolrTestCaseJ4 ###Ending testPerReplicaStateCollection

org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException: Error from server at http://127.0.0.1:65178/solr: Invalid replica : core_node8 in shard/collection : shard1/perReplicaState_test available replicas are core_node2,core_node6,core_node10
    at __randomizedtesting.SeedInfo.seed([D7017DB2FFB75346:FD3CD6F05F17894B]:0)
    at app//org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:720)
    at app//org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:234)
    at app//org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:215)
    at app//org.apache.solr.client.solrj.impl.LBSolrClient.doRequest(LBSolrClient.java:405)
    at app//org.apache.solr.client.solrj.impl.LBSolrClient.request(LBSolrClient.java:371)
    at app//org.apache.solr.client.solrj.impl.CloudSolrClient.sendRequest(CloudSolrClient.java:1174)
    at app//org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:880)
    at app//org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:807)
    at app//org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:234)
    at app//org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:249)
    at app//org.apache.solr.common.cloud.PerReplicaStatesIntegrationTest.testPerReplicaStateCollection(PerReplicaStatesIntegrationTest.java:91)
    at java.base@11.0.9/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base@11.0.9/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base@11.0.9/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base@11.0.9/java.lang.reflect.Method.invoke(Method.java:566)
    at app//com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)

@risdenk
Copy link
Contributor

risdenk commented Oct 26, 2022

@joel-bernstein that error was being looked at. it should be fixed on main. I can help fix the merge conflicts since they are due to some of the changes I've made.

@risdenk
Copy link
Contributor

risdenk commented Oct 26, 2022

FWIW on your branch ran into when running ./gradlew check -x test -Pvalidation.errorprone=true

* What went wrong:
Execution failed for task ':solr:solrj-streaming:analyzeTestClassesDependencies'.
> Dependency analysis found issues.
  usedUndeclaredArtifacts
   - com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.1@jar
   - org.apache.lucene:lucene-test-framework:9.4.0@jar
   - org.apache.solr:solrj-streaming:10.0.0-SNAPSHOT@
  unusedDeclaredArtifacts
   - com.google.guava:guava:31.1-jre@jar
   - commons-io:commons-io:2.11.0@jar
   - org.apache.zookeeper:zookeeper:3.8.0@jar

@risdenk
Copy link
Contributor

risdenk commented Oct 26, 2022

@joel-bernstein I merged main, fixed the dependency issues, and a ref guide link. ./gradlew check -x test -Pvalidation.errorprone=true now passes and ./gradlew -p solr/solrj-streaming check passes.

Copy link
Contributor

@risdenk risdenk left a comment

Choose a reason for hiding this comment

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

I wonder if testRuntimeOnly "org.hsqldb:hsqldb" // runtime because via JDBC reflection is still needed in solr/solrj/build.gradle

@risdenk
Copy link
Contributor

risdenk commented Oct 26, 2022

@joel-bernstein all tests pass too!

./gradlew clean
...
./gradlew check -Pvalidation.errorprone=true
...
BUILD SUCCESSFUL in 19m 13s
610 actionable tasks: 556 executed, 54 up-to-date

@joel-bernstein joel-bernstein marked this pull request as ready for review October 27, 2022 20:17
@joel-bernstein
Copy link
Contributor Author

@risdenk, thanks for the commits on this! I pulled all the latest and things look good.

Does the solrj build.gradle need to refer to solrj-streaming so 9x users don't have a back compat issue?

@risdenk risdenk changed the title SOLR-15733: Migrate streaming SOLR-15733: Separate out a solrj-streaming module Oct 27, 2022
@risdenk
Copy link
Contributor

risdenk commented Oct 27, 2022

@joel-bernstein I'd do that separately on branch_9x only - similar to 8088917

@joel-bernstein
Copy link
Contributor Author

I don't have the merge button. Let me see if I can figure out why.

@joel-bernstein
Copy link
Contributor Author

I checked my account at id.apache.org and my github account is there. So this may take a jira to infra to sort out.

I have this branch squash merged to main locally and am running tests. I can push it out from my local repo or @risdenk you can merge from here.

@joel-bernstein
Copy link
Contributor Author

I am also a member of the apache organization on github.

@risdenk
Copy link
Contributor

risdenk commented Oct 28, 2022

@joel-bernstein I don't see you listed here https://github.com/orgs/apache/teams/solr-committers/members?query=joel - its a private list if you are on it you can see it. I see your username here https://whimsy.apache.org/roster/committer/jbernste

so not sure what is going on

Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

solrj/build.gradle shouldn't need hsqldb anymore; right? And it shouldn't depend on 'solr:modules:sql' if the corresponding tests have been moved.

Copy link
Contributor

@janhoy janhoy left a comment

Choose a reason for hiding this comment

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

I assume this is the PR that will stay in main branch, since there is no dependency added in solrj's build.gradle to depend on solrj-streaming?

Should there not be some refguide docs in streaming about the need to add solrj-streaming as a dependency to your app if you need the IO classes?

I also assume there will be a backport PR that adds the transitive dependency from solrj to solrj-zookeeper, perhaps along with a note in the Upgrade Notes for 9.2 that you can now opt out of solrj-streaming on client if you don't use it, simply by excluding the coordinates in your POM.

@joel-bernstein
Copy link
Contributor Author

I'm not able to see https://github.com/orgs/apache/teams/solr-committers/members?query=joel which must be the reason I'm not seeing the merge button. Is this something that infra needs to fix or does the Solr pmc manage this list?

@joel-bernstein
Copy link
Contributor Author

@dsmiley I believe Solrj no long needs the hsql dependency. The solrj-streaming dependency on solr:modules:sql I believe is only there to support tests for the JDBCStream and JDBC driver. Both of which could eventually be moved to solrj-jdbc.

@dsmiley
Copy link
Contributor

dsmiley commented Oct 28, 2022

Shouldn't those tests move out of solrj(core) now?

@risdenk
Copy link
Contributor

risdenk commented Oct 28, 2022

I assume this is the PR that will stay in main branch, since there is no dependency added in solrj's build.gradle to depend on solrj-streaming?

@janhoy yes - will add to branch_9x like solrj-zookeeper did - see #1099 (comment). @dsmiley asked the same question on the Jira.

Should there not be some refguide docs in streaming about the need to add solrj-streaming as a dependency to your app if you need the IO classes?

good catch will need to update.

I also assume there will be a backport PR that adds the transitive dependency from solrj to solrj-zookeeper, perhaps along with a note in the Upgrade Notes for 9.2 that you can now opt out of solrj-streaming on client if you don't use it, simply by excluding the coordinates in your POM.

yup makes sense.

solrj/build.gradle shouldn't need hsqldb anymore; right? And it shouldn't depend on 'solr:modules:sql' if the corresponding tests have been moved.

@joel-bernstein I can help take another look at the dependencies.

@risdenk
Copy link
Contributor

risdenk commented Oct 28, 2022

Added a note to solrj refguide for solrj-streaming.

git grep -F hsql | grep -Fv -e 'solr/solrj-streaming'
NOTICE.txt:HSQL Database (HSQLDB): http://hsqldb.org/
NOTICE.txt:License: http://hsqldb.org/web/hsqlLicense.html
NOTICE.txt:For work added by the HSQL Development Group (a.k.a. hsqldb_lic.txt):
solr/solrj/build.gradle:  testRuntimeOnly "org.hsqldb:hsqldb" // runtime because via JDBC reflection
versions.lock:org.hsqldb:hsqldb:2.4.0 (1 constraints: 08050136)
versions.props:org.hsqldb:hsqldb=2.4.0

hsqldb does not look to be used in solr/solrj anymore so will remove and run tests.

need to check on sql module still.

@risdenk
Copy link
Contributor

risdenk commented Oct 28, 2022

removed hsqldb and sql module from solrj core. both solrj core and solrj streaming tests pass. Rerunning the whole test suite now.

@risdenk
Copy link
Contributor

risdenk commented Oct 28, 2022

@dsmiley / @janhoy I think I addressed your concerns so far. The only one not addressed (yet) is only for branch_9x to add upgrade notes and opting out of solrj-streaming.

@HoustonPutman
Copy link
Contributor

Looked through the gradle stuff and it looks good to me.

@risdenk
Copy link
Contributor

risdenk commented Oct 28, 2022

./gradlew check -Pvalidation.errorprone=true passed with changes pushed so far.

@joel-bernstein
Copy link
Contributor Author

The merge button has appeared for me. Anything more to do or should we merge?

@risdenk
Copy link
Contributor

risdenk commented Oct 30, 2022

I think this is good to go. Just need to do follow up on branch_9x after this is merged and backported to branch_9x - #1099 (comment)

@joel-bernstein joel-bernstein merged commit db28836 into apache:main Nov 1, 2022
joel-bernstein added a commit to joel-bernstein/solr that referenced this pull request Nov 4, 2022
* SOLR-15733: Initial commit WIP

* SOLR-15733: Move solrj.client.io

* SOLR-15733: Fix directories

* SOLR-15733: Move tests

* SOLR-15733: Remove commons math from main solrj

* SOLR-15733: Wire-in solrj-streaming

* SOLR-15733: Get solrj-streaming test classes to compile

* SOLR-15733: Get solrj-streaming tests passing

* Fix dependency declarations

* Fix ref guide to DaemonStream reference

* Add solrj refguide note

* Remove hsqldb test dependency from solr/solrj

* Cleanup solrj sql reference

Co-authored-by: Kevin Risden <krisden@apache.org>
@risdenk
Copy link
Contributor

risdenk commented Nov 4, 2022

backport to branch_9x here: #1161

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