Skip to content

Fix Solr 10 migration#1833

Open
dpol1 wants to merge 3 commits intoapache:mainfrom
dpol1:fix/solr-10-migration
Open

Fix Solr 10 migration#1833
dpol1 wants to merge 3 commits intoapache:mainfrom
dpol1:fix/solr-10-migration

Conversation

@dpol1
Copy link
Contributor

@dpol1 dpol1 commented Mar 20, 2026

Fixes #1831

@rzo1 rzo1 requested a review from mvolikas March 20, 2026 19:45
@rzo1 rzo1 added this to the 3.5.2 milestone Mar 20, 2026
@rzo1 rzo1 added enhancement dependency dependency upgrade labels Mar 20, 2026
@rzo1
Copy link
Contributor

rzo1 commented Mar 20, 2026

Hi @dpol1

thanks for the PR !

Can you check the pipeline status? Guess it needs auto formatting. Thanks

@dpol1
Copy link
Contributor Author

dpol1 commented Mar 20, 2026

Oops, my bad 😅

@dpol1 dpol1 force-pushed the fix/solr-10-migration branch from 956a76f to 721d892 Compare March 20, 2026 20:29
Copy link
Contributor

@rzo1 rzo1 left a comment

Choose a reason for hiding this comment

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

For me, it looks good but I am not deep into SOLR.

@rzo1
Copy link
Contributor

rzo1 commented Mar 21, 2026

Thanks for the PR, @dpol1

-->
<config>
<luceneMatchVersion>9.0.0</luceneMatchVersion>
<luceneMatchVersion>10.0.0</luceneMatchVersion>
Copy link
Contributor

Choose a reason for hiding this comment

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

The default configsets in Solr 10.0.0 use <luceneMatchVersion>10.3</luceneMatchVersion>, so we might as well pin to this version instead (minor).

"--name",
collectionName,
"-n",
"--conf-name",
Copy link
Contributor

Choose a reason for hiding this comment

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

Some options (like --conf-name) are not documented in the Solr Control Script Reference, but are shown when running bin/solr create --help so I guess are ok to use.

}
}
});
CompletableFuture.runAsync(
Copy link
Contributor

Choose a reason for hiding this comment

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

This wraps a synchronous request, which will only block a different thread.
That is the reason why we had used lbHttp2SolrClient.requestAsync which will start a "real" async network request to Solr. (see #1488 and the discussion here)

We could keep both the old logic and the new CloudSolrClient by doing the following:

  1. When building the CloudSolrClient, specify a HttpJettySolrClient (like you do for the ConcurrentUpdateJettySolrClient) to ensure that the created LBSolrClient will be an LBAsyncSolrClient.
HttpJettySolrClient jettyClient = new HttpJettySolrClient.Builder().build();

CloudSolrClient.Builder builder =
        new CloudSolrClient.Builder(
                Collections.singletonList(zkHost), Optional.empty())
                .withHttpClient(jettyClient);
  1. Get the async client before making a request.
LBAsyncSolrClient lbAsyncSolrClient = (LBAsyncSolrClient) ((CloudHttp2SolrClient) cloudClient).getLbClient();

CloudHttp2SolrClient cloudHttp2SolrClient = (CloudHttp2SolrClient) client;
DocCollection col = cloudHttp2SolrClient.getClusterState().getCollection(collection);
CloudSolrClient cloudClient = (CloudSolrClient) client;
DocCollection col = cloudClient.getClusterState().getCollection(collection);
Copy link
Contributor

Choose a reason for hiding this comment

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

cloudClient.getClusterState() is deprecated. We can use cloudClient.getClusterStateProvider().getClusterState() instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency dependency upgrade enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address breaking changes introduced in SolrJ 10

3 participants