Conversation
|
Hi @dpol1 thanks for the PR ! Can you check the pipeline status? Guess it needs auto formatting. Thanks |
|
Oops, my bad 😅 |
956a76f to
721d892
Compare
rzo1
left a comment
There was a problem hiding this comment.
For me, it looks good but I am not deep into SOLR.
|
Thanks for the PR, @dpol1 |
| --> | ||
| <config> | ||
| <luceneMatchVersion>9.0.0</luceneMatchVersion> | ||
| <luceneMatchVersion>10.0.0</luceneMatchVersion> |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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:
- When building the
CloudSolrClient, specify aHttpJettySolrClient(like you do for theConcurrentUpdateJettySolrClient) to ensure that the createdLBSolrClientwill be anLBAsyncSolrClient.
HttpJettySolrClient jettyClient = new HttpJettySolrClient.Builder().build();
CloudSolrClient.Builder builder =
new CloudSolrClient.Builder(
Collections.singletonList(zkHost), Optional.empty())
.withHttpClient(jettyClient);
- 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); |
There was a problem hiding this comment.
cloudClient.getClusterState() is deprecated. We can use cloudClient.getClusterStateProvider().getClusterState() instead.
Fixes #1831