Repository navigation
Upgrade to Solr 10.1 - #7036
Upgrade to Solr 10.1#7036
Conversation
Lambeaux
left a comment
There was a problem hiding this comment.
Adding comments for reviewer context.
16b201b to
25a9cf8
Compare
andrewkfiedler
left a comment
There was a problem hiding this comment.
Built the solr modules locally and ran the factory and backup / restore tests against them, all good. A few small things inline if you have time.
| // Solr URLs instead of communicating with ZooKeeper. It’s not likely to be removed before Solr | ||
| // 11." | ||
| HttpJdkSolrClient.Builder httpBuilder = new HttpJdkSolrClient.Builder(); | ||
| if (Boolean.getBoolean("solr.useBasicAuth")) { |
There was a problem hiding this comment.
Might be worth adding a test that covers this branch with an ENC(...) password. I swapped the decryptValue call for the raw property locally and every test in this module still passed (the itests turn basic auth on with a plaintext password, so they wouldn't catch it either).
Something like this would work:
@After
public void clearProperties() {
System.clearProperty("solr.useBasicAuth");
System.clearProperty("solr.username");
System.clearProperty("solr.password");
}
@Test
public void basicAuthPasswordIsDecrypted() throws Exception {
System.setProperty("solr.useBasicAuth", "true");
System.setProperty("solr.username", "admin");
System.setProperty("solr.password", "ENC(abc)");
when(encryptionService.decryptValue("ENC(abc)")).thenReturn("secret");
try (CloudSolrClient client =
new SolrCloudClientFactory(encryptionService).newCloudSolrClient("localhost:2181", "c")) {
verify(encryptionService).decryptValue("ENC(abc)");
}
}| } | ||
| } | ||
|
|
||
| private HttpJdkSolrClient.Builder solrHttpClientBuilder() { |
There was a problem hiding this comment.
We could pull this into one place since SolrCloudClientFactory.newCloudSolrClient builds the same thing. solr-factory-impl is already embedded in this bundle, so a public static on the factory works without any export changes:
public static HttpJdkSolrClient.Builder httpClientBuilder(EncryptionService encryptionService) {
HttpJdkSolrClient.Builder builder = new HttpJdkSolrClient.Builder();
if (Boolean.getBoolean("solr.useBasicAuth")) {
builder.withBasicAuthCredentials(
System.getProperty("solr.username"),
encryptionService.decryptValue(System.getProperty("solr.password")));
}
return builder;
}Then both spots can use .withHttpClientBuilder(SolrCloudClientFactory.httpClientBuilder(encryptionService)).
| <bundle>mvn:org.apache.httpcomponents/httpcore-osgi/${solr.httpcore.version}</bundle> | ||
| <bundle>mvn:org.apache.httpcomponents/httpclient-osgi/${solr.httpclient.version}</bundle> |
There was a problem hiding this comment.
So one thing I noticed is that with these gone, catalog-solr-commands still imports org.apache.http and only resolves because catalog-plugin-oauth happens to be installed alongside it. Both the standard and catalog profiles install it so nothing breaks, but the import is only there for unused code.
I know this isn't due to your changes, but printResponse(HttpResponse) in BackupCommand and RestoreCommand isn't called anywhere, same with mockResponse in SolrCommandTest. Deleting those lets us drop the httpcore / httpclient / httpmime deps from the catalog-solr-commands pom. I tried it locally and the bundle no longer imports org.apache.http (tests still pass).
What does this PR do?
Initial change to bump Solr to 10.1
Who is reviewing it?
@jaymcnallie
@jrnorth
@clockard
How should this be tested?
Any background context you want to provide?
Refer to the official change list for Solr for comprehensive details. But here are some important things to keep in mind:
Regarding the Apache Archive
It seems we can rely on the Apache archive now. Refer to https://www.apache.org/legal/release-policy.html#archived, specifically: