From c4f15e31befd61b9e8a42d9ba72fe7e10a3a8948 Mon Sep 17 00:00:00 2001 From: Houston Putman Date: Fri, 2 Dec 2022 11:46:36 -0600 Subject: [PATCH 01/18] SOLR-15955: Fix dependency in hadoop-auth (#1204) --- solr/modules/hadoop-auth/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solr/modules/hadoop-auth/build.gradle b/solr/modules/hadoop-auth/build.gradle index 93d1ae6a4ba..07867619401 100644 --- a/solr/modules/hadoop-auth/build.gradle +++ b/solr/modules/hadoop-auth/build.gradle @@ -36,7 +36,7 @@ dependencies { implementation 'org.slf4j:slf4j-api' - compileOnlyApi 'org.eclipse.jetty.toolchain:jetty-servlet-api' + api 'org.eclipse.jetty.toolchain:jetty-servlet-api' implementation 'com.fasterxml.jackson.core:jackson-core' implementation 'com.google.guava:guava' @@ -103,7 +103,7 @@ dependencies { exclude group: "org.apache.yetus", module: "audience-annotations" }) // required for instantiating a Zookeeper server in tests or embedded - runtimeOnly ('org.xerial.snappy:snappy-java') + testRuntimeOnly ('org.xerial.snappy:snappy-java') } From 5878ec7d488f7d3e45c68c91cddd12393efafb8d Mon Sep 17 00:00:00 2001 From: David Smiley Date: Fri, 2 Dec 2022 13:59:39 -0500 Subject: [PATCH 02/18] Refactor: remove unused "filter" in QueryCommand & getProcessedFilter (#1197) * QueryCommand: remove unused "filter" * SolrIndexSearcher.getProcessedFilter: remove unused setFilter param --- .../handler/component/ExpandComponent.java | 2 +- .../java/org/apache/solr/search/Grouping.java | 3 +- .../org/apache/solr/search/QueryCommand.java | 25 ---- .../apache/solr/search/SolrIndexSearcher.java | 110 +++++------------- .../solr/search/grouping/CommandHandler.java | 3 +- .../org/apache/solr/util/SolrPluginUtils.java | 3 +- .../solr/highlight/HighlighterTest.java | 3 +- .../solr/search/SolrIndexSearcherTest.java | 8 +- 8 files changed, 37 insertions(+), 120 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java b/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java index 17372d154aa..30820b071f7 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/ExpandComponent.java @@ -432,7 +432,7 @@ public void process(ResponseBuilder rb) throws IOException { newFilters.add(groupQuery); } - SolrIndexSearcher.ProcessedFilter pfilter = searcher.getProcessedFilter(null, newFilters); + SolrIndexSearcher.ProcessedFilter pfilter = searcher.getProcessedFilter(newFilters); if (pfilter.postFilter != null) { pfilter.postFilter.setLastDelegate(groupExpandCollector); collector = pfilter.postFilter; diff --git a/solr/core/src/java/org/apache/solr/search/Grouping.java b/solr/core/src/java/org/apache/solr/search/Grouping.java index 0d28b7d4c6f..13dcf3413cd 100644 --- a/solr/core/src/java/org/apache/solr/search/Grouping.java +++ b/solr/core/src/java/org/apache/solr/search/Grouping.java @@ -309,8 +309,7 @@ public void execute() throws IOException { DocListAndSet out = new DocListAndSet(); qr.setDocListAndSet(out); - SolrIndexSearcher.ProcessedFilter pf = - searcher.getProcessedFilter(cmd.getFilter(), cmd.getFilterList()); + SolrIndexSearcher.ProcessedFilter pf = searcher.getProcessedFilter(cmd.getFilterList()); final Query filterQuery = pf.filter; maxDoc = searcher.maxDoc(); diff --git a/solr/core/src/java/org/apache/solr/search/QueryCommand.java b/solr/core/src/java/org/apache/solr/search/QueryCommand.java index 8da580d95ec..33bfdc28070 100755 --- a/solr/core/src/java/org/apache/solr/search/QueryCommand.java +++ b/solr/core/src/java/org/apache/solr/search/QueryCommand.java @@ -31,7 +31,6 @@ public class QueryCommand { private String queryID; private boolean isQueryCancellable; private List filterList; - private DocSet filter; private Sort sort; private int offset; private int len; @@ -79,10 +78,6 @@ public List getFilterList() { * @throws IllegalArgumentException if filter is not null. */ public QueryCommand setFilterList(List filterList) { - if (filter != null) { - throw new IllegalArgumentException( - "Either filter or filterList may be set in the QueryCommand, but not both."); - } this.filterList = filterList; return this; } @@ -93,10 +88,6 @@ public QueryCommand setFilterList(List filterList) { * @throws IllegalArgumentException if filter is not null. */ public QueryCommand setFilterList(Query f) { - if (filter != null) { - throw new IllegalArgumentException( - "Either filter or filterList may be set in the QueryCommand, but not both."); - } filterList = null; if (f != null) { filterList = new ArrayList<>(2); @@ -105,22 +96,6 @@ public QueryCommand setFilterList(Query f) { return this; } - public DocSet getFilter() { - return filter; - } - - /** - * @throws IllegalArgumentException if filterList is not null. - */ - public QueryCommand setFilter(DocSet filter) { - if (filterList != null) { - throw new IllegalArgumentException( - "Either filter or filterList may be set in the QueryCommand, but not both."); - } - this.filter = filter; - return this; - } - public Sort getSort() { return sort; } diff --git a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java index 7a415c44e35..6ee88cf740d 100644 --- a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java +++ b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java @@ -1094,7 +1094,7 @@ public BitDocSet offerLiveDocs(Supplier docSetSupplier, int suppliedSize */ public DocSet getDocSet(List queries) throws IOException { - ProcessedFilter pf = getProcessedFilter(null, queries); + ProcessedFilter pf = getProcessedFilter(queries); if (pf.postFilter == null) { if (pf.answer != null) { @@ -1123,11 +1123,11 @@ public DocSet getDocSet(List queries) throws IOException { } /** - * INTERNAL: The response object from {@link #getProcessedFilter(DocSet, List)}. Holds a filter - * and postFilter pair that together match a set of documents. Either of them may be null, in - * which case the semantics are to match everything. + * INTERNAL: The response object from {@link #getProcessedFilter(List)}. Holds a filter and + * postFilter pair that together match a set of documents. Either of them may be null, in which + * case the semantics are to match everything. * - * @see #getProcessedFilter(DocSet, List) + * @see #getProcessedFilter(List) */ public static class ProcessedFilter { // maybe null. Sometimes we have a docSet answer that represents the complete answer or result. @@ -1137,22 +1137,17 @@ public static class ProcessedFilter { } /** - * INTERNAL: Processes conjunction (AND) of both args into a {@link ProcessedFilter} result. - * Either arg may be null/empty thus doesn't restrict the matching docs. Queries typically are + * INTERNAL: Processes conjunction (AND) of the queries into a {@link ProcessedFilter} result. + * Queries may be null/empty thus doesn't restrict the matching docs. Queries typically are * resolved against the filter cache, and populate it. */ - public ProcessedFilter getProcessedFilter(DocSet setFilter, List queries) - throws IOException { + public ProcessedFilter getProcessedFilter(List queries) throws IOException { ProcessedFilter pf = new ProcessedFilter(); if (queries == null || queries.size() == 0) { - if (setFilter != null) { - pf.answer = setFilter; - pf.filter = setFilter.makeQuery(); - } return pf; } - // We combine all the filter queries that come from the filter cache & setFilter into "answer". + // We combine all the filter queries that come from the filter cache into "answer". // This might become pf.answer but not if there are any non-cached filters DocSet answer = null; @@ -1163,10 +1158,6 @@ public ProcessedFilter getProcessedFilter(DocSet setFilter, List queries) int end = 0; // size of "sets" and "neg"; parallel arrays - if (setFilter != null) { - answer = setFilter; - } // we are done with setFilter at this point - for (Query q : queries) { if (q instanceof ExtendedQuery) { ExtendedQuery eq = (ExtendedQuery) q; @@ -1546,12 +1537,9 @@ private void getDocListC(QueryResult qr, QueryCommand cmd) throws IOException { } // we can try and look up the complete query in the cache. - // we can't do that if filter!=null though (we don't want to - // do hashCode() and equals() for a big DocSet). if (queryResultCache != null - && cmd.getFilter() == null && (flags & (NO_CHECK_QCACHE | NO_SET_QCACHE)) != ((NO_CHECK_QCACHE | NO_SET_QCACHE))) { - // all of the current flags can be reused during warming, + // all the current flags can be reused during warming, // so set all of them on the cache key. key = new QueryResultKey(q, cmd.getFilterList(), cmd.getSort(), flags, cmd.getMinExactCount()); @@ -1649,7 +1637,7 @@ private void getDocListC(QueryResult qr, QueryCommand cmd) throws IOException { // for large filters that match few documents, this may be // slower than simply re-executing the query. if (out.docSet == null) { - out.docSet = getDocSet(cmd.getQuery(), cmd.getFilter()); + out.docSet = getDocSet(cmd.getQuery()); List filterList = cmd.getFilterList(); if (filterList != null && !filterList.isEmpty()) { out.docSet = DocSetUtil.getDocSet(out.docSet.intersection(getDocSet(filterList)), this); @@ -1802,7 +1790,7 @@ private void getDocListNC(QueryResult qr, QueryCommand cmd) throws IOException { boolean needScores = (cmd.getFlags() & GET_SCORES) != 0; - ProcessedFilter pf = getProcessedFilter(cmd.getFilter(), cmd.getFilterList()); + ProcessedFilter pf = getProcessedFilter(cmd.getFilterList()); final Query query = QueryUtils.combineQueryAndFilter(QueryUtils.makeQueryable(cmd.getQuery()), pf.filter); Relation hitsRelation; @@ -1923,7 +1911,7 @@ private DocSet getDocListAndSetNC(QueryResult qr, QueryCommand cmd) throws IOExc int maxDoc = maxDoc(); cmd.setMinExactCount(Integer.MAX_VALUE); // We need the full DocSet - ProcessedFilter pf = getProcessedFilter(cmd.getFilter(), cmd.getFilterList()); + ProcessedFilter pf = getProcessedFilter(cmd.getFilterList()); final Query query = QueryUtils.combineQueryAndFilter(QueryUtils.makeQueryable(cmd.getQuery()), pf.filter); @@ -2030,20 +2018,19 @@ public ScoreMode scoreMode() { } /** - * Returns documents matching both query and filter and sorted by - * sort. FUTURE: The returned DocList may be retrieved from a cache. + * Returns documents matching query, sorted by sort. + * + *

FUTURE: The returned DocList may be retrieved from a cache. * - * @param filter may be null * @param lsort criteria by which to sort (if null, query relevance is used) * @param offset offset into the list of documents to return * @param len maximum number of documents to return * @return DocList meeting the specified criteria, should not be modified by the caller. * @throws IOException If there is a low-level I/O error. */ - public DocList getDocList(Query query, DocSet filter, Sort lsort, int offset, int len) - throws IOException { + public DocList getDocList(Query query, Sort lsort, int offset, int len) throws IOException { QueryCommand qc = new QueryCommand(); - qc.setQuery(query).setFilter(filter).setSort(lsort).setOffset(offset).setLen(len); + qc.setQuery(query).setSort(lsort).setOffset(offset).setLen(len); QueryResult qr = new QueryResult(); search(qr, qc); return qr.getDocList(); @@ -2155,11 +2142,12 @@ public DocListAndSet getDocListAndSet( /** * Returns documents matching both query and the intersection of filterList - * , sorted by sort. Also returns the compete set of documents matching - * query and filter (regardless of offset and len). + * , sorted by sort. Also returns the complete set of documents matching + * query and filter (regardless of offset and len + * ). * - *

This method is cache aware and may retrieve filter from the cache or make an - * insertion into the cache as a result of this call. + *

This method is cache aware and may retrieve filters from the cache or make an insertion into + * the cache as a result of this call. * *

FUTURE: The returned DocList may be retrieved from a cache. * @@ -2191,13 +2179,12 @@ public DocListAndSet getDocListAndSet( } /** - * Returns documents matching both query and filter and sorted by - * sort. Also returns the compete set of documents matching query and - * filter (regardless of offset and len). + * Returns the top documents matching the query and sorted by + * sort, limited by offset and len. Also returns compete set of + * matching documents as a {@link DocSet}. * *

FUTURE: The returned DocList may be retrieved from a cache. * - * @param filter may be null * @param lsort criteria by which to sort (if null, query relevance is used) * @param offset offset into the list of documents to return * @param len maximum number of documents to return @@ -2205,51 +2192,10 @@ public DocListAndSet getDocListAndSet( * caller. * @throws IOException If there is a low-level I/O error. */ - public DocListAndSet getDocListAndSet(Query query, DocSet filter, Sort lsort, int offset, int len) + public DocListAndSet getDocListAndSet(Query query, Sort lsort, int offset, int len) throws IOException { QueryCommand qc = new QueryCommand(); - qc.setQuery(query) - .setFilter(filter) - .setSort(lsort) - .setOffset(offset) - .setLen(len) - .setNeedDocSet(true); - QueryResult qr = new QueryResult(); - search(qr, qc); - return qr.getDocListAndSet(); - } - - /** - * Returns documents matching both query and filter and sorted by - * sort. Also returns the compete set of documents matching query and - * filter (regardless of offset and len). - * - *

This method is cache aware and may make an insertion into the cache as a result of this - * call. - * - *

FUTURE: The returned DocList may be retrieved from a cache. - * - *

The DocList and DocSet returned should not be modified. - * - * @param filter may be null - * @param lsort criteria by which to sort (if null, query relevance is used) - * @param offset offset into the list of documents to return - * @param len maximum number of documents to return - * @param flags user supplied flags for the result set - * @return DocListAndSet meeting the specified criteria, should not be modified by the - * caller. - * @throws IOException If there is a low-level I/O error. - */ - public DocListAndSet getDocListAndSet( - Query query, DocSet filter, Sort lsort, int offset, int len, int flags) throws IOException { - QueryCommand qc = new QueryCommand(); - qc.setQuery(query) - .setFilter(filter) - .setSort(lsort) - .setOffset(offset) - .setLen(len) - .setFlags(flags) - .setNeedDocSet(true); + qc.setQuery(query).setSort(lsort).setOffset(offset).setLen(len).setNeedDocSet(true); QueryResult qr = new QueryResult(); search(qr, qc); return qr.getDocListAndSet(); diff --git a/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java b/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java index 99224d881f6..9fc5fee28ed 100644 --- a/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java +++ b/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java @@ -149,8 +149,7 @@ public void execute() throws IOException { collectors.addAll(command.create()); } - ProcessedFilter filter = - searcher.getProcessedFilter(queryCommand.getFilter(), queryCommand.getFilterList()); + ProcessedFilter filter = searcher.getProcessedFilter(queryCommand.getFilterList()); Query query = QueryUtils.makeQueryable(queryCommand.getQuery()); if (truncateGroups) { diff --git a/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java b/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java index 88d3044fda5..85093cd6af6 100644 --- a/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java +++ b/solr/core/src/java/org/apache/solr/util/SolrPluginUtils.java @@ -72,7 +72,6 @@ import org.apache.solr.schema.SchemaField; import org.apache.solr.search.DocIterator; import org.apache.solr.search.DocList; -import org.apache.solr.search.DocSet; import org.apache.solr.search.FieldParams; import org.apache.solr.search.QParser; import org.apache.solr.search.QueryParsing; @@ -443,7 +442,7 @@ public static DocList doSimpleQuery(String sreq, SolrQueryRequest req, int start sort = SortSpecParsing.parseSortSpec(commands.get(1), req).getSort(); } - DocList results = req.getSearcher().getDocList(query, (DocSet) null, sort, start, limit); + DocList results = req.getSearcher().getDocList(query, sort, start, limit); return results; } catch (SyntaxError e) { throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Error parsing query: " + qs); diff --git a/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java b/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java index 73c47e14690..fd7bcfcb9c5 100644 --- a/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java +++ b/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java @@ -41,7 +41,6 @@ import org.apache.solr.handler.component.SearchComponent; import org.apache.solr.request.SolrQueryRequest; import org.apache.solr.response.SolrQueryResponse; -import org.apache.solr.search.DocSet; import org.junit.After; import org.junit.BeforeClass; import org.junit.Test; @@ -1399,7 +1398,7 @@ public void payloadFilteringSpanQuery() throws IOException { SolrQueryResponse resp = new SolrQueryResponse(); ResponseBuilder rb = new ResponseBuilder(req, resp, Collections.singletonList(hlComp)); rb.setHighlightQuery(query); - rb.setResults(req.getSearcher().getDocListAndSet(query, (DocSet) null, null, 0, 1)); + rb.setResults(req.getSearcher().getDocListAndSet(query, null, 0, 1)); // highlight: hlComp.prepare(rb); hlComp.process(rb); diff --git a/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java b/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java index a93caafb194..be7f458587b 100644 --- a/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java +++ b/solr/core/src/test/org/apache/solr/search/SolrIndexSearcherTest.java @@ -382,7 +382,7 @@ public void testMinExactWithFilters() throws Exception { Query filterQuery = new TermQuery(new Term("field4_t", Integer.toString(NUM_DOCS - 1))); cmd.setFilterList(filterQuery); - assertNull(searcher.getProcessedFilter(null, cmd.getFilterList()).postFilter); + assertNull(searcher.getProcessedFilter(cmd.getFilterList()).postFilter); assertMatchesEqual(1, searcher, cmd); return null; }); @@ -404,7 +404,7 @@ public void testMinExactWithPostFilters() throws Exception { QueryCommand cmd = createBasicQueryCommand(1, 1, "field4_t", "0"); MockPostFilter filterQuery = new MockPostFilter(1, 101); cmd.setFilterList(filterQuery); - assertNotNull(searcher.getProcessedFilter(null, cmd.getFilterList()).postFilter); + assertNotNull(searcher.getProcessedFilter(cmd.getFilterList()).postFilter); assertMatchesEqual(1, searcher, cmd); return null; }); @@ -415,7 +415,7 @@ public void testMinExactWithPostFilters() throws Exception { QueryCommand cmd = createBasicQueryCommand(1, 1, "field4_t", "0"); MockPostFilter filterQuery = new MockPostFilter(100, 101); cmd.setFilterList(filterQuery); - assertNotNull(searcher.getProcessedFilter(null, cmd.getFilterList()).postFilter); + assertNotNull(searcher.getProcessedFilter(cmd.getFilterList()).postFilter); assertMatchesGreaterThan(NUM_DOCS, searcher, cmd); return null; }); @@ -430,7 +430,7 @@ public void testMinExactWithPostFilterThatChangesScoreMode() throws Exception { MockPostFilter filterQuery = new MockPostFilter(NUM_DOCS * 10, 101, ScoreMode.COMPLETE); cmd.setFilterList(filterQuery); - assertNotNull(searcher.getProcessedFilter(null, cmd.getFilterList()).postFilter); + assertNotNull(searcher.getProcessedFilter(cmd.getFilterList()).postFilter); assertMatchesEqual(NUM_DOCS, searcher, cmd); return null; }); From 8a5ec6963fcc5299d34fb1288e6918f9fe965d9a Mon Sep 17 00:00:00 2001 From: Christine Poerschke Date: Sat, 3 Dec 2022 11:45:18 +0000 Subject: [PATCH 03/18] SOLR-16442: upgrade to Lucene 9.4.2 (#1187) --- solr/CHANGES.txt | 2 +- .../lucene-analysis-common-9.4.1.jar.sha1 | 1 - .../lucene-analysis-common-9.4.2.jar.sha1 | 1 + .../lucene-analysis-icu-9.4.1.jar.sha1 | 1 - .../lucene-analysis-icu-9.4.2.jar.sha1 | 1 + .../lucene-analysis-kuromoji-9.4.1.jar.sha1 | 1 - .../lucene-analysis-kuromoji-9.4.2.jar.sha1 | 1 + .../lucene-analysis-morfologik-9.4.1.jar.sha1 | 1 - .../lucene-analysis-morfologik-9.4.2.jar.sha1 | 1 + .../lucene-analysis-nori-9.4.1.jar.sha1 | 1 - .../lucene-analysis-nori-9.4.2.jar.sha1 | 1 + .../lucene-analysis-opennlp-9.4.1.jar.sha1 | 1 - .../lucene-analysis-opennlp-9.4.2.jar.sha1 | 1 + .../lucene-analysis-phonetic-9.4.1.jar.sha1 | 1 - .../lucene-analysis-phonetic-9.4.2.jar.sha1 | 1 + .../lucene-analysis-smartcn-9.4.1.jar.sha1 | 1 - .../lucene-analysis-smartcn-9.4.2.jar.sha1 | 1 + .../lucene-analysis-stempel-9.4.1.jar.sha1 | 1 - .../lucene-analysis-stempel-9.4.2.jar.sha1 | 1 + .../lucene-backward-codecs-9.4.1.jar.sha1 | 1 - .../lucene-backward-codecs-9.4.2.jar.sha1 | 1 + .../lucene-classification-9.4.1.jar.sha1 | 1 - .../lucene-classification-9.4.2.jar.sha1 | 1 + solr/licenses/lucene-codecs-9.4.1.jar.sha1 | 1 - solr/licenses/lucene-codecs-9.4.2.jar.sha1 | 1 + solr/licenses/lucene-core-9.4.1.jar.sha1 | 1 - solr/licenses/lucene-core-9.4.2.jar.sha1 | 1 + .../lucene-expressions-9.4.1.jar.sha1 | 1 - .../lucene-expressions-9.4.2.jar.sha1 | 1 + solr/licenses/lucene-grouping-9.4.1.jar.sha1 | 1 - solr/licenses/lucene-grouping-9.4.2.jar.sha1 | 1 + .../lucene-highlighter-9.4.1.jar.sha1 | 1 - .../lucene-highlighter-9.4.2.jar.sha1 | 1 + solr/licenses/lucene-join-9.4.1.jar.sha1 | 1 - solr/licenses/lucene-join-9.4.2.jar.sha1 | 1 + solr/licenses/lucene-memory-9.4.1.jar.sha1 | 1 - solr/licenses/lucene-memory-9.4.2.jar.sha1 | 1 + solr/licenses/lucene-misc-9.4.1.jar.sha1 | 1 - solr/licenses/lucene-misc-9.4.2.jar.sha1 | 1 + solr/licenses/lucene-queries-9.4.1.jar.sha1 | 1 - solr/licenses/lucene-queries-9.4.2.jar.sha1 | 1 + .../lucene-queryparser-9.4.1.jar.sha1 | 1 - .../lucene-queryparser-9.4.2.jar.sha1 | 1 + solr/licenses/lucene-sandbox-9.4.1.jar.sha1 | 1 - solr/licenses/lucene-sandbox-9.4.2.jar.sha1 | 1 + .../lucene-spatial-extras-9.4.1.jar.sha1 | 1 - .../lucene-spatial-extras-9.4.2.jar.sha1 | 1 + solr/licenses/lucene-spatial3d-9.4.1.jar.sha1 | 1 - solr/licenses/lucene-spatial3d-9.4.2.jar.sha1 | 1 + solr/licenses/lucene-suggest-9.4.1.jar.sha1 | 1 - solr/licenses/lucene-suggest-9.4.2.jar.sha1 | 1 + .../lucene-test-framework-9.4.1.jar.sha1 | 1 - .../lucene-test-framework-9.4.2.jar.sha1 | 1 + versions.lock | 52 +++++++++---------- versions.props | 2 +- 55 files changed, 54 insertions(+), 54 deletions(-) delete mode 100644 solr/licenses/lucene-analysis-common-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-analysis-common-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-analysis-icu-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-analysis-icu-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-analysis-kuromoji-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-analysis-kuromoji-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-analysis-morfologik-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-analysis-morfologik-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-analysis-nori-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-analysis-nori-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-analysis-opennlp-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-analysis-opennlp-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-analysis-phonetic-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-analysis-phonetic-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-analysis-smartcn-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-analysis-smartcn-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-analysis-stempel-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-analysis-stempel-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-backward-codecs-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-backward-codecs-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-classification-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-classification-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-codecs-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-codecs-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-core-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-core-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-expressions-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-expressions-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-grouping-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-grouping-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-highlighter-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-highlighter-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-join-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-join-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-memory-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-memory-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-misc-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-misc-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-queries-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-queries-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-queryparser-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-queryparser-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-sandbox-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-sandbox-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-spatial-extras-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-spatial-extras-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-spatial3d-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-spatial3d-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-suggest-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-suggest-9.4.2.jar.sha1 delete mode 100644 solr/licenses/lucene-test-framework-9.4.1.jar.sha1 create mode 100644 solr/licenses/lucene-test-framework-9.4.2.jar.sha1 diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 73dd725657f..e9859787965 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -125,7 +125,7 @@ Build * SOLR-16476: Remove commons-text dependency from solr-core (Kevin Risden) -* SOLR-16442: Upgrade to Lucene 9.4.1 (Christine Poerschke) +* SOLR-16442: Upgrade to Lucene 9.4.2 (Christine Poerschke) * SOLR-16508: Upgrade gradle wrapper to 7.6 (Kevin Risden) diff --git a/solr/licenses/lucene-analysis-common-9.4.1.jar.sha1 b/solr/licenses/lucene-analysis-common-9.4.1.jar.sha1 deleted file mode 100644 index 8de2cc0b374..00000000000 --- a/solr/licenses/lucene-analysis-common-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -692cbd2e220222adff279e922d1c14bb10dae8b0 diff --git a/solr/licenses/lucene-analysis-common-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-common-9.4.2.jar.sha1 new file mode 100644 index 00000000000..275136a6c55 --- /dev/null +++ b/solr/licenses/lucene-analysis-common-9.4.2.jar.sha1 @@ -0,0 +1 @@ +fc0c95d5bdd0f604ffe165f6eb4db82621455ebe diff --git a/solr/licenses/lucene-analysis-icu-9.4.1.jar.sha1 b/solr/licenses/lucene-analysis-icu-9.4.1.jar.sha1 deleted file mode 100644 index 7dec2c09c85..00000000000 --- a/solr/licenses/lucene-analysis-icu-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b217251a8c13669ec4066871d026e4cb84abf702 diff --git a/solr/licenses/lucene-analysis-icu-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-icu-9.4.2.jar.sha1 new file mode 100644 index 00000000000..7870d457164 --- /dev/null +++ b/solr/licenses/lucene-analysis-icu-9.4.2.jar.sha1 @@ -0,0 +1 @@ +b0fb7442f6ddf9b8f8f806aa55d28ce03b4ba8ce diff --git a/solr/licenses/lucene-analysis-kuromoji-9.4.1.jar.sha1 b/solr/licenses/lucene-analysis-kuromoji-9.4.1.jar.sha1 deleted file mode 100644 index ed0d01b081a..00000000000 --- a/solr/licenses/lucene-analysis-kuromoji-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -d80cf8993498784bcb6e4dcefdcebd3ddc4ca022 diff --git a/solr/licenses/lucene-analysis-kuromoji-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-kuromoji-9.4.2.jar.sha1 new file mode 100644 index 00000000000..b09d3d933fc --- /dev/null +++ b/solr/licenses/lucene-analysis-kuromoji-9.4.2.jar.sha1 @@ -0,0 +1 @@ +5151fa1b681ad12444b6a1d76f480bce7c6f207f diff --git a/solr/licenses/lucene-analysis-morfologik-9.4.1.jar.sha1 b/solr/licenses/lucene-analysis-morfologik-9.4.1.jar.sha1 deleted file mode 100644 index 7027d1f0143..00000000000 --- a/solr/licenses/lucene-analysis-morfologik-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -ec94415a249a7814fa76d96667173fae875112a2 diff --git a/solr/licenses/lucene-analysis-morfologik-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-morfologik-9.4.2.jar.sha1 new file mode 100644 index 00000000000..23429e420db --- /dev/null +++ b/solr/licenses/lucene-analysis-morfologik-9.4.2.jar.sha1 @@ -0,0 +1 @@ +01bd18ed02ea704f6ef475b61266d319bc6d22e7 diff --git a/solr/licenses/lucene-analysis-nori-9.4.1.jar.sha1 b/solr/licenses/lucene-analysis-nori-9.4.1.jar.sha1 deleted file mode 100644 index 2b5c307e3a6..00000000000 --- a/solr/licenses/lucene-analysis-nori-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -082f4870f58b17bcc60dedb399fe82964ef0ad6f diff --git a/solr/licenses/lucene-analysis-nori-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-nori-9.4.2.jar.sha1 new file mode 100644 index 00000000000..4a051ae313b --- /dev/null +++ b/solr/licenses/lucene-analysis-nori-9.4.2.jar.sha1 @@ -0,0 +1 @@ +b5fb67c14b61b7afb4b3ba147e03bcb323cba7f8 diff --git a/solr/licenses/lucene-analysis-opennlp-9.4.1.jar.sha1 b/solr/licenses/lucene-analysis-opennlp-9.4.1.jar.sha1 deleted file mode 100644 index 85ca3818401..00000000000 --- a/solr/licenses/lucene-analysis-opennlp-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -eef2e12127338b9c39e8f120afdc2966596eed79 diff --git a/solr/licenses/lucene-analysis-opennlp-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-opennlp-9.4.2.jar.sha1 new file mode 100644 index 00000000000..bf5bd6ae81c --- /dev/null +++ b/solr/licenses/lucene-analysis-opennlp-9.4.2.jar.sha1 @@ -0,0 +1 @@ +59b878224557a0164517383cb16dda9c8505e305 diff --git a/solr/licenses/lucene-analysis-phonetic-9.4.1.jar.sha1 b/solr/licenses/lucene-analysis-phonetic-9.4.1.jar.sha1 deleted file mode 100644 index 6d6bdada25c..00000000000 --- a/solr/licenses/lucene-analysis-phonetic-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -733411a30c1b1b473b93d4b28f59f8914d7ed83f diff --git a/solr/licenses/lucene-analysis-phonetic-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-phonetic-9.4.2.jar.sha1 new file mode 100644 index 00000000000..b2c010a2c5e --- /dev/null +++ b/solr/licenses/lucene-analysis-phonetic-9.4.2.jar.sha1 @@ -0,0 +1 @@ +bfbf3ba09dea738c38bd2eb1b468a33973cb808e diff --git a/solr/licenses/lucene-analysis-smartcn-9.4.1.jar.sha1 b/solr/licenses/lucene-analysis-smartcn-9.4.1.jar.sha1 deleted file mode 100644 index 6afd7c01ce3..00000000000 --- a/solr/licenses/lucene-analysis-smartcn-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -19d011e47bab7ccd1389095834d18ad7bf98f050 diff --git a/solr/licenses/lucene-analysis-smartcn-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-smartcn-9.4.2.jar.sha1 new file mode 100644 index 00000000000..6bc4c2964b6 --- /dev/null +++ b/solr/licenses/lucene-analysis-smartcn-9.4.2.jar.sha1 @@ -0,0 +1 @@ +47a9098cd851ae7f013f50885f97051e62aa7781 diff --git a/solr/licenses/lucene-analysis-stempel-9.4.1.jar.sha1 b/solr/licenses/lucene-analysis-stempel-9.4.1.jar.sha1 deleted file mode 100644 index fec2601f469..00000000000 --- a/solr/licenses/lucene-analysis-stempel-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7e48a8d411fffb331484c9485a6bdbf1d856ba06 diff --git a/solr/licenses/lucene-analysis-stempel-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-stempel-9.4.2.jar.sha1 new file mode 100644 index 00000000000..6e91b8b8d1f --- /dev/null +++ b/solr/licenses/lucene-analysis-stempel-9.4.2.jar.sha1 @@ -0,0 +1 @@ +913f692e5592f813e1013102e9e06a34fc0d987b diff --git a/solr/licenses/lucene-backward-codecs-9.4.1.jar.sha1 b/solr/licenses/lucene-backward-codecs-9.4.1.jar.sha1 deleted file mode 100644 index 195931e5a9c..00000000000 --- a/solr/licenses/lucene-backward-codecs-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2826b0fd18033b6d1625b8313ab28c7f43fac692 diff --git a/solr/licenses/lucene-backward-codecs-9.4.2.jar.sha1 b/solr/licenses/lucene-backward-codecs-9.4.2.jar.sha1 new file mode 100644 index 00000000000..1041a229f07 --- /dev/null +++ b/solr/licenses/lucene-backward-codecs-9.4.2.jar.sha1 @@ -0,0 +1 @@ +5f82b75c01bb134aadcf549e2b0295a1417d71b4 diff --git a/solr/licenses/lucene-classification-9.4.1.jar.sha1 b/solr/licenses/lucene-classification-9.4.1.jar.sha1 deleted file mode 100644 index a148a38dbdc..00000000000 --- a/solr/licenses/lucene-classification-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -ad0ffb65dc004f09e9d0fecd5cc16aea4b174a1e diff --git a/solr/licenses/lucene-classification-9.4.2.jar.sha1 b/solr/licenses/lucene-classification-9.4.2.jar.sha1 new file mode 100644 index 00000000000..08d7825e904 --- /dev/null +++ b/solr/licenses/lucene-classification-9.4.2.jar.sha1 @@ -0,0 +1 @@ +de275ff6ed779f34368da823428386f179d3c337 diff --git a/solr/licenses/lucene-codecs-9.4.1.jar.sha1 b/solr/licenses/lucene-codecs-9.4.1.jar.sha1 deleted file mode 100644 index 6c3c9e5f155..00000000000 --- a/solr/licenses/lucene-codecs-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -18760cca02b2c020a228b82e004f791d42c04b7a diff --git a/solr/licenses/lucene-codecs-9.4.2.jar.sha1 b/solr/licenses/lucene-codecs-9.4.2.jar.sha1 new file mode 100644 index 00000000000..11c6526f6bf --- /dev/null +++ b/solr/licenses/lucene-codecs-9.4.2.jar.sha1 @@ -0,0 +1 @@ +468de55c642677e52e898443c5bf8546c7274985 diff --git a/solr/licenses/lucene-core-9.4.1.jar.sha1 b/solr/licenses/lucene-core-9.4.1.jar.sha1 deleted file mode 100644 index 8afb424e7ea..00000000000 --- a/solr/licenses/lucene-core-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -48ff655927016066d4746b485d63f0586d859c5f diff --git a/solr/licenses/lucene-core-9.4.2.jar.sha1 b/solr/licenses/lucene-core-9.4.2.jar.sha1 new file mode 100644 index 00000000000..469e66d8b0b --- /dev/null +++ b/solr/licenses/lucene-core-9.4.2.jar.sha1 @@ -0,0 +1 @@ +e9e7fe827e814839d8826d83cffdbd9d255150c4 diff --git a/solr/licenses/lucene-expressions-9.4.1.jar.sha1 b/solr/licenses/lucene-expressions-9.4.1.jar.sha1 deleted file mode 100644 index 73dd6823864..00000000000 --- a/solr/licenses/lucene-expressions-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -574ac602f98475c1d061adee71ed90dce2eee679 diff --git a/solr/licenses/lucene-expressions-9.4.2.jar.sha1 b/solr/licenses/lucene-expressions-9.4.2.jar.sha1 new file mode 100644 index 00000000000..7631965e1dd --- /dev/null +++ b/solr/licenses/lucene-expressions-9.4.2.jar.sha1 @@ -0,0 +1 @@ +f433ede87302221b48703a890e5f5701cf1b021d diff --git a/solr/licenses/lucene-grouping-9.4.1.jar.sha1 b/solr/licenses/lucene-grouping-9.4.1.jar.sha1 deleted file mode 100644 index f59d9fa64d9..00000000000 --- a/solr/licenses/lucene-grouping-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -690585f53f4ea00fae94c72fbf711f693a3981c5 diff --git a/solr/licenses/lucene-grouping-9.4.2.jar.sha1 b/solr/licenses/lucene-grouping-9.4.2.jar.sha1 new file mode 100644 index 00000000000..23e68ebb352 --- /dev/null +++ b/solr/licenses/lucene-grouping-9.4.2.jar.sha1 @@ -0,0 +1 @@ +2b8addf8bfe8515a2dcd5185cfe8dde493e98d2a diff --git a/solr/licenses/lucene-highlighter-9.4.1.jar.sha1 b/solr/licenses/lucene-highlighter-9.4.1.jar.sha1 deleted file mode 100644 index d746489f8a5..00000000000 --- a/solr/licenses/lucene-highlighter-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -e97e3003a80c67ddf33a456ab54413b12764d23d diff --git a/solr/licenses/lucene-highlighter-9.4.2.jar.sha1 b/solr/licenses/lucene-highlighter-9.4.2.jar.sha1 new file mode 100644 index 00000000000..1525de500e6 --- /dev/null +++ b/solr/licenses/lucene-highlighter-9.4.2.jar.sha1 @@ -0,0 +1 @@ +76eb0793f495045ef18b4324a47b94f50a1a163f diff --git a/solr/licenses/lucene-join-9.4.1.jar.sha1 b/solr/licenses/lucene-join-9.4.1.jar.sha1 deleted file mode 100644 index 2d8705866cf..00000000000 --- a/solr/licenses/lucene-join-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -8749a1b71eacb85c47ed90265ea98c1c8b4e5abd diff --git a/solr/licenses/lucene-join-9.4.2.jar.sha1 b/solr/licenses/lucene-join-9.4.2.jar.sha1 new file mode 100644 index 00000000000..2670eae909b --- /dev/null +++ b/solr/licenses/lucene-join-9.4.2.jar.sha1 @@ -0,0 +1 @@ +18646fccd677af1ed8d56f3697aa693396d22704 diff --git a/solr/licenses/lucene-memory-9.4.1.jar.sha1 b/solr/licenses/lucene-memory-9.4.1.jar.sha1 deleted file mode 100644 index 2fb615cab25..00000000000 --- a/solr/licenses/lucene-memory-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -89797042e65179325f40c173fc20e227d3df4f29 diff --git a/solr/licenses/lucene-memory-9.4.2.jar.sha1 b/solr/licenses/lucene-memory-9.4.2.jar.sha1 new file mode 100644 index 00000000000..45e581f1972 --- /dev/null +++ b/solr/licenses/lucene-memory-9.4.2.jar.sha1 @@ -0,0 +1 @@ +685522495dea97e493784aac1f414d218e3019df diff --git a/solr/licenses/lucene-misc-9.4.1.jar.sha1 b/solr/licenses/lucene-misc-9.4.1.jar.sha1 deleted file mode 100644 index 2fe67483c09..00000000000 --- a/solr/licenses/lucene-misc-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -ae8465d5499ab39012c3c81d82014667c5c03dd2 diff --git a/solr/licenses/lucene-misc-9.4.2.jar.sha1 b/solr/licenses/lucene-misc-9.4.2.jar.sha1 new file mode 100644 index 00000000000..c785c7ce8c0 --- /dev/null +++ b/solr/licenses/lucene-misc-9.4.2.jar.sha1 @@ -0,0 +1 @@ +59f0ee89d9a06dd1c297d7d86981c39c87c51018 diff --git a/solr/licenses/lucene-queries-9.4.1.jar.sha1 b/solr/licenses/lucene-queries-9.4.1.jar.sha1 deleted file mode 100644 index 2089a37dd01..00000000000 --- a/solr/licenses/lucene-queries-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -c78e99a46fabd2a7a175fe170a1537de2b9bca95 diff --git a/solr/licenses/lucene-queries-9.4.2.jar.sha1 b/solr/licenses/lucene-queries-9.4.2.jar.sha1 new file mode 100644 index 00000000000..6b1617d6bd5 --- /dev/null +++ b/solr/licenses/lucene-queries-9.4.2.jar.sha1 @@ -0,0 +1 @@ +d102a8c6cba1ff028a0127035565be005e78ef8e diff --git a/solr/licenses/lucene-queryparser-9.4.1.jar.sha1 b/solr/licenses/lucene-queryparser-9.4.1.jar.sha1 deleted file mode 100644 index 788ffd42e7a..00000000000 --- a/solr/licenses/lucene-queryparser-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -98051f363cd92fd324aca47b662c4a71b9419e49 diff --git a/solr/licenses/lucene-queryparser-9.4.2.jar.sha1 b/solr/licenses/lucene-queryparser-9.4.2.jar.sha1 new file mode 100644 index 00000000000..4c8cec0edc2 --- /dev/null +++ b/solr/licenses/lucene-queryparser-9.4.2.jar.sha1 @@ -0,0 +1 @@ +322aa2ca41f66c002b5d0ab1d21264d65ff5b9c5 diff --git a/solr/licenses/lucene-sandbox-9.4.1.jar.sha1 b/solr/licenses/lucene-sandbox-9.4.1.jar.sha1 deleted file mode 100644 index c5883fc4717..00000000000 --- a/solr/licenses/lucene-sandbox-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -6c82a38b0fe1042ef11751cdbb1be689b7a00428 diff --git a/solr/licenses/lucene-sandbox-9.4.2.jar.sha1 b/solr/licenses/lucene-sandbox-9.4.2.jar.sha1 new file mode 100644 index 00000000000..36c6d950646 --- /dev/null +++ b/solr/licenses/lucene-sandbox-9.4.2.jar.sha1 @@ -0,0 +1 @@ +a45e07fd4b70f868115bab5de704181680be9f04 diff --git a/solr/licenses/lucene-spatial-extras-9.4.1.jar.sha1 b/solr/licenses/lucene-spatial-extras-9.4.1.jar.sha1 deleted file mode 100644 index 8d6990863e4..00000000000 --- a/solr/licenses/lucene-spatial-extras-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7171406be9b864a4929edff8601b3d69645c64ae diff --git a/solr/licenses/lucene-spatial-extras-9.4.2.jar.sha1 b/solr/licenses/lucene-spatial-extras-9.4.2.jar.sha1 new file mode 100644 index 00000000000..a6bf174c996 --- /dev/null +++ b/solr/licenses/lucene-spatial-extras-9.4.2.jar.sha1 @@ -0,0 +1 @@ +18bd925556054addda907bfd3334ab4b4cc9e258 diff --git a/solr/licenses/lucene-spatial3d-9.4.1.jar.sha1 b/solr/licenses/lucene-spatial3d-9.4.1.jar.sha1 deleted file mode 100644 index 930368c6584..00000000000 --- a/solr/licenses/lucene-spatial3d-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -5ede97d83f0c62ba84ae1e2279f411ae87ecaca1 diff --git a/solr/licenses/lucene-spatial3d-9.4.2.jar.sha1 b/solr/licenses/lucene-spatial3d-9.4.2.jar.sha1 new file mode 100644 index 00000000000..86434e186dd --- /dev/null +++ b/solr/licenses/lucene-spatial3d-9.4.2.jar.sha1 @@ -0,0 +1 @@ +daf5b0ebc57270ab7be639c0cfac4ba388e2775c diff --git a/solr/licenses/lucene-suggest-9.4.1.jar.sha1 b/solr/licenses/lucene-suggest-9.4.1.jar.sha1 deleted file mode 100644 index f0bfefd0b1e..00000000000 --- a/solr/licenses/lucene-suggest-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -60e7740d2894ac7a0e97c3eabaee4823a02b0f9c diff --git a/solr/licenses/lucene-suggest-9.4.2.jar.sha1 b/solr/licenses/lucene-suggest-9.4.2.jar.sha1 new file mode 100644 index 00000000000..9951eb761cc --- /dev/null +++ b/solr/licenses/lucene-suggest-9.4.2.jar.sha1 @@ -0,0 +1 @@ +e7749ec8f263a658104580a03d71bcb362370faf diff --git a/solr/licenses/lucene-test-framework-9.4.1.jar.sha1 b/solr/licenses/lucene-test-framework-9.4.1.jar.sha1 deleted file mode 100644 index e3a7b2adec2..00000000000 --- a/solr/licenses/lucene-test-framework-9.4.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -db48bf06f76dc74e64dfb568f5ecdb94d5f45dff diff --git a/solr/licenses/lucene-test-framework-9.4.2.jar.sha1 b/solr/licenses/lucene-test-framework-9.4.2.jar.sha1 new file mode 100644 index 00000000000..a20bf3f9100 --- /dev/null +++ b/solr/licenses/lucene-test-framework-9.4.2.jar.sha1 @@ -0,0 +1 @@ +dad1e731a41a184fdfe60bc6d1d0fe48b363af5f diff --git a/versions.lock b/versions.lock index 82be5b8abbf..2abf7a6207b 100644 --- a/versions.lock +++ b/versions.lock @@ -165,32 +165,32 @@ org.apache.logging.log4j:log4j-core:2.19.0 (4 constraints: 98447217) org.apache.logging.log4j:log4j-layout-template-json:2.19.0 (1 constraints: 3e054a3b) org.apache.logging.log4j:log4j-slf4j2-impl:2.19.0 (1 constraints: 3e054a3b) org.apache.logging.log4j:log4j-web:2.19.0 (1 constraints: 3e054a3b) -org.apache.lucene:lucene-analysis-common:9.4.1 (10 constraints: de9e685a) -org.apache.lucene:lucene-analysis-icu:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-analysis-kuromoji:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-analysis-morfologik:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-analysis-nori:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-analysis-opennlp:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-analysis-phonetic:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-analysis-smartcn:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-analysis-stempel:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-backward-codecs:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-classification:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-codecs:9.4.1 (3 constraints: a2250244) -org.apache.lucene:lucene-core:9.4.1 (26 constraints: 15908d64) -org.apache.lucene:lucene-expressions:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-grouping:9.4.1 (2 constraints: e61520e4) -org.apache.lucene:lucene-highlighter:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-join:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-memory:9.4.1 (1 constraints: 9a0fac83) -org.apache.lucene:lucene-misc:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-queries:9.4.1 (6 constraints: ba513e79) -org.apache.lucene:lucene-queryparser:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-sandbox:9.4.1 (2 constraints: dd14fca0) -org.apache.lucene:lucene-spatial-extras:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-spatial3d:9.4.1 (1 constraints: bd10b4b9) -org.apache.lucene:lucene-suggest:9.4.1 (1 constraints: 10052536) -org.apache.lucene:lucene-test-framework:9.4.1 (1 constraints: 10052536) +org.apache.lucene:lucene-analysis-common:9.4.2 (10 constraints: e89eec62) +org.apache.lucene:lucene-analysis-icu:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-analysis-kuromoji:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-analysis-morfologik:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-analysis-nori:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-analysis-opennlp:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-analysis-phonetic:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-analysis-smartcn:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-analysis-stempel:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-backward-codecs:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-classification:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-codecs:9.4.2 (3 constraints: a5259244) +org.apache.lucene:lucene-core:9.4.2 (26 constraints: 2f90a69c) +org.apache.lucene:lucene-expressions:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-grouping:9.4.2 (2 constraints: e81552e4) +org.apache.lucene:lucene-highlighter:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-join:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-memory:9.4.2 (1 constraints: 9b0fad83) +org.apache.lucene:lucene-misc:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-queries:9.4.2 (6 constraints: c051d07b) +org.apache.lucene:lucene-queryparser:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-sandbox:9.4.2 (2 constraints: df142ba1) +org.apache.lucene:lucene-spatial-extras:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-spatial3d:9.4.2 (1 constraints: be10b5b9) +org.apache.lucene:lucene-suggest:9.4.2 (1 constraints: 11052636) +org.apache.lucene:lucene-test-framework:9.4.2 (1 constraints: 11052636) org.apache.opennlp:opennlp-tools:1.9.4 (3 constraints: 0823a25b) org.apache.pdfbox:fontbox:2.0.26 (1 constraints: 180b72d8) org.apache.pdfbox:jbig2-imageio:3.0.4 (1 constraints: 5e0cef01) diff --git a/versions.props b/versions.props index 47fef78a61d..612bdec8463 100644 --- a/versions.props +++ b/versions.props @@ -49,7 +49,7 @@ org.apache.httpcomponents:httpcore=4.4.15 org.apache.httpcomponents:httpmime=4.5.13 org.apache.kerby:*=1.0.1 org.apache.logging.log4j:*=2.19.0 -org.apache.lucene:*=9.4.1 +org.apache.lucene:*=9.4.2 org.apache.opennlp:opennlp-tools=1.9.4 org.apache.tika:*=1.28.4 org.apache.zookeeper:*=3.8.0 From 1a940ade468074fb6bfed8acf699d2f2c570edf5 Mon Sep 17 00:00:00 2001 From: Christine Poerschke Date: Sat, 3 Dec 2022 11:46:10 +0000 Subject: [PATCH 04/18] SOLR-16442: git mechanics for 'gradlew updateLicenses' in lucene-upgrade.md (#1188) --- dev-docs/lucene-upgrade.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev-docs/lucene-upgrade.md b/dev-docs/lucene-upgrade.md index d337024332d..9ff683a4cb9 100644 --- a/dev-docs/lucene-upgrade.md +++ b/dev-docs/lucene-upgrade.md @@ -44,6 +44,8 @@ gradlew --write-locks ``` gradlew updateLicenses + +git add solr/licenses ``` ## Code From 4519c1fcb050c4b2bbcb21e3c2583455fbfdb3a2 Mon Sep 17 00:00:00 2001 From: Bruno Roustant <33934988+bruno-roustant@users.noreply.github.com> Date: Mon, 5 Dec 2022 18:03:13 +0100 Subject: [PATCH 05/18] SOLR-16473: Fix race condition in shard split when a sub-shard is put in recovery state. Co-authored-by: Andy Vuong --- solr/CHANGES.txt | 1 + .../solr/cloud/api/collections/SplitShardCmd.java | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index e9859787965..e86ec35c31e 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -116,6 +116,7 @@ Bug Fixes * SOLR-16165: Rare Deadlock in SlotAcc initialization (Justin Sweeney, noble) +* SOLR-16473: Fix race condition in shard split when a sub-shard is put in recovery state. (Andy Vuong via Bruno Roustant) Build --------------------- diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/SplitShardCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/SplitShardCmd.java index 0193e0b1939..0212db16ed2 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/SplitShardCmd.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/SplitShardCmd.java @@ -38,6 +38,7 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import org.apache.solr.client.solrj.cloud.DistribStateManager; @@ -779,6 +780,20 @@ public boolean split(ClusterState clusterState, ZkNodeProps message, NamedList { + for (String subSlice : subSlices) { + if (!collectionState.getSlice(subSlice).getState().equals(Slice.State.RECOVERY)) { + return false; + } + } + return true; + }); } t = timings.sub("createCoresForReplicas"); From 704f3960ad6a6ba0a48c704303b3ab77479409cb Mon Sep 17 00:00:00 2001 From: Noble Paul Date: Tue, 6 Dec 2022 15:26:12 +1100 Subject: [PATCH 06/18] SOLR-15732: queries to missing collection are slow (#1207) --- solr/CHANGES.txt | 4 ++++ .../java/org/apache/solr/servlet/HttpSolrCall.java | 10 +++++++++- .../org/apache/solr/common/cloud/ZkStateReader.java | 11 +++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index e86ec35c31e..2456af2f334 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -81,6 +81,7 @@ Improvements (Houston Putman) * SOLR-16565: posting the same file to the package store should not throw an error (noble) + Optimizations --------------------- @@ -88,6 +89,9 @@ Optimizations * SOLR-16555: SolrIndexSearcher - FilterCache intersections/andNot should not clone bitsets repeatedly (Kevin Risden, David Smiley) +* SOLR-15732: queries to missing collection are slow (noble) + + Bug Fixes --------------------- diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java index debd481a9a3..4a453d6f897 100644 --- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java +++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java @@ -469,7 +469,15 @@ protected void extractRemotePath(String collectionName, String origCorename) } else { if (!retry) { // we couldn't find a core to work with, try reloading aliases & this collection - cores.getZkController().getZkStateReader().aliasesManager.update(); + if (!cores.getZkController().getZkStateReader().aliasesManager.update() + && !cores + .getZkController() + .zkStateReader + .getZkClient() + .exists(DocCollection.getCollectionPath(collectionName), true)) { + // no change and such a collection does not exist. go back + return; + } cores.getZkController().zkStateReader.forceUpdateCollection(collectionName); action = RETRY; } diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java index 7e2c626431c..9011f750876 100644 --- a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java +++ b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java @@ -2289,10 +2289,17 @@ public void applyModificationAndExportToZk(UnaryOperator op) { * @return true if an update was performed */ public boolean update() throws KeeperException, InterruptedException { - log.debug("Checking ZK for most up to date Aliases {}", ALIASES); + if (log.isDebugEnabled()) { + log.debug("Checking ZK for most up to date Aliases {}", ALIASES); + } + Stat stat = zkClient.getZooKeeper().exists(ALIASES, null); + if (stat == null || stat.getVersion() <= aliases.getZNodeVersion()) { + return false; + } else { + stat = new Stat(); + } // Call sync() first to ensure the subsequent read (getData) is up to date. zkClient.getZooKeeper().sync(ALIASES, null, null); - Stat stat = new Stat(); final byte[] data = zkClient.getData(ALIASES, null, stat, true); return setIfNewer(Aliases.fromJSON(data, stat.getVersion())); } From 8e00c9c181a54f1ce456221073ed2665a1c6f34e Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Tue, 6 Dec 2022 15:43:40 -0500 Subject: [PATCH 07/18] SOLR-8975: Use Builder Pattern with all Solr Clients where possible (#1211) Introduce Builder setters for setters that exist on SolrClients for responseParser, requestWriter. Deprecated these SolrClient setters useMultiPartPost, and followRedirects. Update corresponding tests to use these changes. Migrate to try/with resources for Solr Clients where possible in tests. Closes SOLR-10455 and SOLR-10459. --- solr/CHANGES.txt | 3 + .../component/HttpShardHandlerFactory.java | 2 +- .../cloud/TestMiniSolrCloudClusterSSL.java | 1 + .../solr/handler/ReplicationTestHelper.java | 7 +- .../handler/TestReplicationHandlerBackup.java | 9 +- .../apache/solr/handler/TestRestoreCore.java | 10 +- ...istributedQueryElevationComponentTest.java | 34 +++-- .../solr/request/TestRemoteStreaming.java | 6 +- .../solr/schema/TestCloudManagedSchema.java | 34 ++--- .../apache/solr/search/TestSmileRequest.java | 4 +- .../exporter/SolrClientFactory.java | 6 +- .../scraper/SolrCloudScraperTest.java | 6 +- .../scraper/SolrStandaloneScraperTest.java | 10 +- .../solrj/impl/CloudHttp2SolrClient.java | 25 ++- .../solrj/impl/CloudLegacySolrClient.java | 7 +- .../client/solrj/impl/CloudSolrClient.java | 10 ++ .../impl/ConcurrentUpdateSolrClient.java | 12 +- .../client/solrj/impl/Http2SolrClient.java | 64 +++++++- .../client/solrj/impl/HttpSolrClient.java | 58 ++++++- .../client/solrj/impl/LBHttp2SolrClient.java | 53 +++++++ .../client/solrj/impl/LBHttpSolrClient.java | 19 ++- .../solr/client/solrj/impl/LBSolrClient.java | 4 + .../client/solrj/impl/SolrClientBuilder.java | 34 +++++ .../solrj/SolrExampleBinaryHttp2Test.java | 25 ++- .../client/solrj/SolrExampleBinaryTest.java | 24 ++- .../solr/client/solrj/SolrExampleTests.java | 23 +-- .../solr/client/solrj/SolrExampleXMLTest.java | 22 +-- .../solrj/SolrSchemalessExampleTest.java | 22 +-- .../solr/client/solrj/TestBatchUpdate.java | 87 ++++++----- .../client/solrj/TestLBHttp2SolrClient.java | 2 +- .../client/solrj/TestSolrJErrorHandling.java | 29 ++-- .../solrj/embedded/SolrExampleJettyTest.java | 142 ++++++------------ .../SolrExampleStreamingBinaryHttp2Test.java | 9 +- .../SolrExampleStreamingBinaryTest.java | 13 +- .../SolrExampleStreamingHttp2Test.java | 13 +- .../embedded/SolrExampleStreamingTest.java | 25 ++- .../embedded/SolrExampleXMLHttp2Test.java | 22 +-- .../solrj/impl/BasicHttpSolrClientTest.java | 73 ++++++--- .../impl/ConcurrentUpdateSolrClientTest.java | 5 +- .../solrj/impl/Http2SolrClientTest.java | 85 +++++++---- .../solrj/impl/HttpSolrClientConPoolTest.java | 46 +++--- .../solrj/impl/LBHttp2SolrClientTest.java | 48 +----- .../response/NoOpResponseParserTest.java | 6 +- .../solr/BaseDistributedSearchTestCase.java | 19 ++- .../org/apache/solr/SolrJettyTestBase.java | 15 +- .../java/org/apache/solr/SolrTestCaseJ4.java | 69 +++++---- .../AbstractBasicDistributedZkTestBase.java | 25 +-- .../cloud/AbstractFullDistribZkTestBase.java | 40 +---- 48 files changed, 714 insertions(+), 593 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 2456af2f334..d34eac70135 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -82,6 +82,9 @@ Improvements * SOLR-16565: posting the same file to the package store should not throw an error (noble) +* SOLR-8975: Introduce Builder setters for setters that exist on SolrClients for responseParser, requestWriter. + Deprecated these SolrClient setters useMultiPartPost, and followRedirects. (Eric Pugh, David Smiley, Kevin Risden) + Optimizations --------------------- diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java index dcb54f6cf51..25aac2e5620 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java +++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java @@ -288,7 +288,7 @@ public void init(PluginInfo info) { .maxConnectionsPerHost(maxConnectionsPerHost) .build(); this.defaultClient.addListenerFactory(this.httpListenerFactory); - this.loadbalancer = new LBHttp2SolrClient(defaultClient); + this.loadbalancer = new LBHttp2SolrClient.Builder(defaultClient).build(); initReplicaListTransformers(getParameter(args, "replicaRouting", null, sb)); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java index 384bd54f0d9..c2734a92616 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestMiniSolrCloudClusterSSL.java @@ -430,6 +430,7 @@ public static SolrClient getRandomizedHttpSolrClient(String url) { // ... so we are hopefully future proofing against possible changes to // SolrTestCaseJ4.getHttpSolrClient that "optimize" the test client construction in a way that // would prevent us from finding bugs with regular HttpSolrClient instantiation. + // This test fails if you return a Http2SolrClient if (random().nextBoolean()) { return (new HttpSolrClient.Builder(url)).build(); } // else... diff --git a/solr/core/src/test/org/apache/solr/handler/ReplicationTestHelper.java b/solr/core/src/test/org/apache/solr/handler/ReplicationTestHelper.java index 3b78b652a7c..ca0a4409a1d 100644 --- a/solr/core/src/test/org/apache/solr/handler/ReplicationTestHelper.java +++ b/solr/core/src/test/org/apache/solr/handler/ReplicationTestHelper.java @@ -66,12 +66,7 @@ public static JettySolrRunner createAndStartJetty(SolrInstance instance) throws } public static SolrClient createNewSolrClient(String baseUrl) { - try { - // set up the client... - return SolrTestCaseJ4.getHttpSolrClient(baseUrl, 15000, 90000); - } catch (Exception ex) { - throw new RuntimeException(ex); - } + return SolrTestCaseJ4.getHttpSolrClient(baseUrl, 15000, 90000); } public static int index(SolrClient s, Object... fields) throws Exception { diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java index 5555e3334f6..b378834c1ba 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java +++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandlerBackup.java @@ -84,13 +84,8 @@ private static JettySolrRunner createAndStartJetty(ReplicationTestHelper.SolrIns } private static SolrClient createNewSolrClient(int port) { - try { - // set up the client... - final String baseUrl = buildUrl(port, context); - return getHttpSolrClient(baseUrl, 15000, 60000); - } catch (Exception ex) { - throw new RuntimeException(ex); - } + final String baseUrl = buildUrl(port, context); + return getHttpSolrClient(baseUrl, 15000, 60000); } @Override diff --git a/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java b/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java index 96c4de7da50..09f8ab7f250 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java +++ b/solr/core/src/test/org/apache/solr/handler/TestRestoreCore.java @@ -67,13 +67,9 @@ private static JettySolrRunner createAndStartJetty(ReplicationTestHelper.SolrIns } private static SolrClient createNewSolrClient(int port) { - try { - // set up the client... - final String baseUrl = buildUrl(port, context); - return getHttpSolrClient(baseUrl, 15000, 60000); - } catch (Exception ex) { - throw new RuntimeException(ex); - } + + final String baseUrl = buildUrl(port, context); + return getHttpSolrClient(baseUrl, 15000, 60000); } @Override diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java index 2de368f74c5..a27b6a6d3a7 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java @@ -166,22 +166,24 @@ public void test() throws Exception { assertEquals(true, document.getFieldValue("[elevated]")); // Force javabin format - final String clientUrl = jettys.get(0).getBaseUrl() + "/collection1"; - SolrClient client = getHttpSolrClient(clientUrl); - ((HttpSolrClient) client).setParser(new BinaryResponseParser()); - SolrQuery solrQuery = - new SolrQuery("XXXX") - .setParam("qt", "/elevate") - .setParam("shards.qt", "/elevate") - .setRows(500) - .setFields("id,[elevated]") - .setParam("enableElevation", "true") - .setParam("forceElevation", "true") - .setParam("elevateIds", "6", "wt", "javabin") - .setSort("id", SolrQuery.ORDER.desc); - setDistributedParams(solrQuery); - response = client.query(solrQuery); - client.close(); + final String clientUrl = jettys.get(0).getBaseUrl() + "/" + "collection1"; + try (SolrClient client = + new HttpSolrClient.Builder(clientUrl) + .withResponseParser(new BinaryResponseParser()) + .build(); ) { + SolrQuery solrQuery = + new SolrQuery("XXXX") + .setParam("qt", "/elevate") + .setParam("shards.qt", "/elevate") + .setRows(500) + .setFields("id,[elevated]") + .setParam("enableElevation", "true") + .setParam("forceElevation", "true") + .setParam("elevateIds", "6", "wt", "javabin") + .setSort("id", SolrQuery.ORDER.desc); + setDistributedParams(solrQuery); + response = client.query(solrQuery); + } assertTrue(response.getResults().getNumFound() > 0); document = response.getResults().get(0); diff --git a/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java b/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java index 917a9ea560e..721eed3a206 100644 --- a/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java +++ b/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java @@ -116,8 +116,10 @@ public void testNoUrlAccess() throws Exception { SolrQuery query = new SolrQuery(); query.setQuery("*:*"); // for anything query.add("stream.url", makeDeleteAllUrl()); - SolrException se = expectThrows(SolrException.class, () -> getSolrClient().query(query)); - assertSame(ErrorCode.BAD_REQUEST, ErrorCode.getErrorCode(se.code())); + try (SolrClient solrClient = createNewSolrClient()) { + SolrException se = expectThrows(SolrException.class, () -> solrClient.query(query)); + assertSame(ErrorCode.BAD_REQUEST, ErrorCode.getErrorCode(se.code())); + } } /** Compose an HTTP GET url that will delete all the data. */ diff --git a/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java b/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java index 3d9acdc61b1..590993ad107 100644 --- a/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java +++ b/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchema.java @@ -18,6 +18,7 @@ import java.nio.charset.StandardCharsets; import java.util.List; +import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.impl.HttpSolrClient; import org.apache.solr.client.solrj.request.QueryRequest; import org.apache.solr.cloud.AbstractFullDistribZkTestBase; @@ -53,21 +54,22 @@ public void test() throws Exception { QueryRequest request = new QueryRequest(params); request.setPath("/admin/cores"); int which = r.nextInt(clients.size()); - HttpSolrClient client = (HttpSolrClient) clients.get(which); - String previousBaseURL = client.getBaseURL(); - // Set client to Solr root url - requests fail otherwise - client.setBaseURL(jettys.get(which).getBaseUrl().toString()); - NamedList namedListResponse = client.request(request); - client.setBaseURL(previousBaseURL); // Restore baseURL - NamedList status = (NamedList) namedListResponse.get("status"); - NamedList collectionStatus = (NamedList) status.getVal(0); - String collectionSchema = (String) collectionStatus.get(CoreAdminParams.SCHEMA); - // Make sure the upgrade to managed schema happened - assertEquals( - "Schema resource name differs from expected name", "managed-schema.xml", collectionSchema); - SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), 30000); - try { + // create a client that does not have the /collection1 as part of the URL. + try (SolrClient rootClient = + new HttpSolrClient.Builder(buildUrl(jettys.get(which).getLocalPort())).build()) { + NamedList namedListResponse = rootClient.request(request); + NamedList status = (NamedList) namedListResponse.get("status"); + NamedList collectionStatus = (NamedList) status.getVal(0); + String collectionSchema = (String) collectionStatus.get(CoreAdminParams.SCHEMA); + // Make sure the upgrade to managed schema happened + assertEquals( + "Schema resource name differs from expected name", + "managed-schema.xml", + collectionSchema); + } + + try (SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), 30000)) { // Make sure "DO NOT EDIT" is in the content of the managed schema String fileContent = getFileContentFromZooKeeper(zkClient, "/solr/configs/conf1/managed-schema.xml"); @@ -79,10 +81,6 @@ public void test() throws Exception { // Make sure the renamed non-managed schema is present in ZooKeeper fileContent = getFileContentFromZooKeeper(zkClient, "/solr/configs/conf1/schema.xml.bak"); assertTrue("schema file doesn't contain 'Note: This setter method is not thread-safe. + * + * @deprecated use {@link CloudHttp2SolrClient.Builder} instead + */ + @Deprecated public void setRequestWriter(RequestWriter requestWriter) { getLbClient().setRequestWriter(requestWriter); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java index 7218a8da455..a3edf13cb3d 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java @@ -107,8 +107,8 @@ protected ConcurrentUpdateSolrClient(Builder builder) { .withHttpClient(builder.httpClient) .withConnectionTimeout(builder.connectionTimeoutMillis) .withSocketTimeout(builder.socketTimeoutMillis) + .withFollowRedirects(false) .build(); - this.client.setFollowRedirects(false); this.queue = new LinkedBlockingQueue<>(builder.queueSize); this.threadCount = builder.threadCount; this.runners = new ArrayDeque<>(); @@ -120,6 +120,7 @@ protected ConcurrentUpdateSolrClient(Builder builder) { throw new RuntimeException( "Invalid stallTime: " + stallTime + "ms, must be 2x > pollQueueTime " + pollQueueTime); } + this.setPollQueueTime(builder.pollQueueTime); if (builder.executorService != null) { this.scheduler = builder.executorService; @@ -828,6 +829,7 @@ public void shutdownNow() { } } + @Deprecated public void setParser(ResponseParser responseParser) { client.setParser(responseParser); } @@ -835,6 +837,7 @@ public void setParser(ResponseParser responseParser) { /** * @param pollQueueTime time for an open connection to wait for updates when the queue is empty. */ + @Deprecated public void setPollQueueTime(int pollQueueTime) { this.pollQueueTime = pollQueueTime; // make sure the stall time is larger than the polling time @@ -845,6 +848,7 @@ public void setPollQueueTime(int pollQueueTime) { } } + @Deprecated public void setRequestWriter(RequestWriter requestWriter) { client.setRequestWriter(requestWriter); } @@ -854,6 +858,7 @@ public static class Builder extends SolrClientBuilder { protected String baseSolrUrl; protected int queueSize = 10; protected int threadCount; + protected int pollQueueTime; protected ExecutorService executorService; protected boolean streamDeletes; @@ -929,6 +934,11 @@ public Builder withThreadCount(int threadCount) { return this; } + public Builder withPollQueueTime(int pollQueueTime) { + this.pollQueueTime = pollQueueTime; + return this; + } + /** * Provides the {@link ExecutorService} for the created client to use when servicing the * update-request queue. diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java index 650215464c2..d5f821b7ba3 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java @@ -132,8 +132,8 @@ public class Http2SolrClient extends SolrClient { private int idleTimeout; private int requestTimeout; - private ResponseParser parser = new BinaryResponseParser(); - private volatile RequestWriter requestWriter = new BinaryRequestWriter(); + protected ResponseParser parser = new BinaryResponseParser(); + protected RequestWriter requestWriter = new BinaryRequestWriter(); private List listenerFactory = new ArrayList<>(); private AsyncTracker asyncTracker = new AsyncTracker(); /** The URL of the Solr server. */ @@ -174,11 +174,18 @@ protected Http2SolrClient(String serverBaseUrl, Builder builder) { } else { basicAuthAuthorizationStr = null; } + if (builder.requestWriter != null) { + requestWriter = builder.requestWriter; + } + if (builder.responseParser != null) { + parser = builder.responseParser; + } if (builder.requestTimeout == null) { requestTimeout = -1; } else { requestTimeout = builder.requestTimeout; } + httpClient.setFollowRedirects(builder.followRedirects); assert ObjectReleaseTracker.track(this); } @@ -891,6 +898,16 @@ private NamedList processErrorsAndResponse( } } + /** + * Choose the {@link RequestWriter} to use. + * + *

By default, {@link BinaryRequestWriter} is used. + * + *

Note: This setter method is not thread-safe. + * + * @deprecated use {@link Http2SolrClient.Builder#withRequestWriter(RequestWriter)} instead + */ + @Deprecated public void setRequestWriter(RequestWriter requestWriter) { this.requestWriter = requestWriter; } @@ -899,6 +916,16 @@ protected RequestWriter getRequestWriter() { return requestWriter; } + /** + * Configure whether the client should follow redirects or not. + * + *

This defaults to false under the assumption that if you are following a redirect to get to a + * Solr installation, something is configured wrong somewhere. + * + * @deprecated use {@link Http2SolrClient.Builder#withFollowRedirects(boolean)} + * Redirects(boolean)} instead + */ + @Deprecated public void setFollowRedirects(boolean follow) { httpClient.setFollowRedirects(follow); } @@ -959,8 +986,11 @@ public static class Builder { private String basicAuthUser; private String basicAuthPassword; private boolean useHttp1_1 = Boolean.getBoolean("solr.http1"); + private boolean followRedirects = false; protected String baseSolrUrl; private ExecutorService executor; + protected RequestWriter requestWriter; + protected ResponseParser responseParser; public Builder() {} @@ -1010,6 +1040,23 @@ public Builder withHttpClient(Http2SolrClient httpClient) { return this; } + /** Provides a {@link RequestWriter} for created clients to use when handing requests. */ + public Builder withRequestWriter(RequestWriter requestWriter) { + this.requestWriter = requestWriter; + return this; + } + + /** Provides a {@link ResponseParser} for created clients to use when handling requests. */ + public Builder withResponseParser(ResponseParser responseParser) { + this.responseParser = responseParser; + return this; + } + + public Builder withFollowRedirects(boolean followRedirects) { + this.followRedirects = followRedirects; + return this; + } + public Builder withExecutor(ExecutorService executor) { this.executor = executor; return this; @@ -1104,8 +1151,17 @@ public ResponseParser getParser() { return parser; } - public void setParser(ResponseParser processor) { - parser = processor; + /** + * Note: This setter method is not thread-safe. + * + * @param parser Default Response Parser chosen to parse the response if the parser were not + * specified as part of the request. + * @see org.apache.solr.client.solrj.SolrRequest#getResponseParser() + * @deprecated use {@link Http2SolrClient.Builder#withResponseParser(ResponseParser)} instead + */ + @Deprecated + public void setParser(ResponseParser parser) { + this.parser = parser; } public static void setDefaultSSLConfig(SSLConfig sslConfig) { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java index aec42d3395b..c13076337aa 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java @@ -73,6 +73,7 @@ import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicNameValuePair; import org.apache.solr.client.solrj.ResponseParser; +import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrRequest; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.V2RequestSupport; @@ -164,6 +165,7 @@ protected HttpSolrClient(Builder builder) { } if (builder.httpClient != null) { + this.followRedirects = builder.followRedirects; this.httpClient = builder.httpClient; this.internalClient = false; } else { @@ -174,10 +176,16 @@ protected HttpSolrClient(Builder builder) { httpClient = HttpClientUtil.createClient(params); } + if (builder.requestWriter != null) { + this.requestWriter = builder.requestWriter; + } + this.parser = builder.responseParser; this.invariantParams = builder.invariantParams; this.connectionTimeout = builder.connectionTimeoutMillis; this.soTimeout = builder.socketTimeoutMillis; + this.useMultiPartPost = builder.useMultiPartPost; + this.queryParams = builder.queryParams; } public Set getQueryParams() { @@ -189,8 +197,12 @@ public Set getQueryParams() { * * @param queryParams set of param keys to only send via the query string Note that the param will * be sent as a query string if the key is part of this Set or the SolrRequest's query params. + *

{@link SolrClient} setters can be unsafe when the involved {@link SolrClient} is used in + * multiple threads simultaneously. To avoid this, use {@link Builder#withQueryParams(Set)}. * @see org.apache.solr.client.solrj.SolrRequest#getQueryParams + * @deprecated use {@link Builder#withQueryParams(Set)} instead */ + @Deprecated public void setQueryParams(Set queryParams) { this.queryParams = queryParams; } @@ -812,7 +824,13 @@ public String getBaseURL() { * * In this case the client is more flexible and can be used to send requests to any cores. The * cost of this is that the core must be specified on each request. + * + *

{@link SolrClient} setters can be unsafe when the involved {@link SolrClient} is used in + * multiple threads simultaneously. + * + * @deprecated use {@link Builder} instead */ + @Deprecated public void setBaseURL(String baseUrl) { this.baseUrl = baseUrl; } @@ -824,12 +842,14 @@ public ResponseParser getParser() { /** * Note: This setter method is not thread-safe. * - * @param processor Default Response Parser chosen to parse the response if the parser were not + * @param parser Default Response Parser chosen to parse the response if the parser were not * specified as part of the request. * @see org.apache.solr.client.solrj.SolrRequest#getResponseParser() + * @deprecated use {@link Builder#withResponseParser(ResponseParser)} instead */ - public void setParser(ResponseParser processor) { - parser = processor; + @Deprecated + public void setParser(ResponseParser parser) { + this.parser = parser; } /** Return the HttpClient this instance uses. */ @@ -841,12 +861,25 @@ public HttpClient getHttpClient() { * Configure whether the client should follow redirects or not. * *

This defaults to false under the assumption that if you are following a redirect to get to a - * Solr installation, something is misconfigured somewhere. + * Solr installation, something is configured wrong somewhere. + * + * @deprecated use {@link Builder#withFollowRedirects(boolean)} Redirects(boolean)} instead */ + @Deprecated public void setFollowRedirects(boolean followRedirects) { this.followRedirects = followRedirects; } + /** + * Choose the {@link RequestWriter} to use. + * + *

By default, {@link BinaryRequestWriter} is used. + * + *

Note: This setter method is not thread-safe. + * + * @deprecated use {@link Builder#withRequestWriter(RequestWriter)} instead + */ + @Deprecated public void setRequestWriter(RequestWriter requestWriter) { this.requestWriter = requestWriter; } @@ -863,7 +896,14 @@ public boolean isUseMultiPartPost() { return useMultiPartPost; } - /** Set the multipart connection properties */ + /** + * Set the multipart connection properties + * + *

Note: This setter method is not thread-safe. + * + * @deprecated use {@link Builder#allowMultiPartPost(Boolean)} instead + */ + @Deprecated public void setUseMultiPartPost(boolean useMultiPartPost) { this.useMultiPartPost = useMultiPartPost; } @@ -940,7 +980,13 @@ public Builder withBaseSolrUrl(String baseSolrUrl) { * In this case the client is more flexible and can be used to send requests to any cores. This * flexibility though requires that the core be specified on all requests. * - *

By default, compression is not enabled on created HttpSolrClient objects. + *

By default, compression is not enabled on created HttpSolrClient objects. By default, + * redirects are not followed in created HttpSolrClient objects. By default, {@link + * BinaryRequestWriter} is used for composing requests. By default, {@link BinaryResponseParser} + * is used for parsing responses. + * + * @param baseSolrUrl the base URL of the Solr server that will be targeted by any created + * clients. */ public Builder(String baseSolrUrl) { this.baseSolrUrl = baseSolrUrl; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java index 4d82a4a6d86..c5bfc631a06 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java @@ -23,6 +23,7 @@ import java.net.SocketException; import java.net.SocketTimeoutException; import java.util.Arrays; +import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; @@ -83,28 +84,66 @@ public class LBHttp2SolrClient extends LBSolrClient { private final Http2SolrClient httpClient; + /** + * @deprecated Use {@link LBHttp2SolrClient.Builder} instead + */ + @Deprecated public LBHttp2SolrClient(Http2SolrClient httpClient, String... baseSolrUrls) { super(Arrays.asList(baseSolrUrls)); this.httpClient = httpClient; } + private LBHttp2SolrClient(Http2SolrClient httpClient, List baseSolrUrls) { + super(baseSolrUrls); + this.httpClient = httpClient; + } + @Override protected SolrClient getClient(String baseUrl) { return httpClient; } + /** + * Note: This setter method is not thread-safe. + * + * @param parser Default Response Parser chosen to parse the response if the parser were not + * specified as part of the request. + * @see org.apache.solr.client.solrj.SolrRequest#getResponseParser() + * @deprecated Pass in a configured {@link Http2SolrClient} instead + */ + @Deprecated @Override public void setParser(ResponseParser parser) { super.setParser(parser); this.httpClient.setParser(parser); } + @Override + public ResponseParser getParser() { + return httpClient.getParser(); + } + + /** + * Choose the {@link RequestWriter} to use. + * + *

By default, {@link BinaryRequestWriter} is used. + * + *

Note: This setter method is not thread-safe. + * + * @deprecated Pass in a configured {@link Http2SolrClient} instead + */ + @Deprecated @Override public void setRequestWriter(RequestWriter writer) { super.setRequestWriter(writer); this.httpClient.setRequestWriter(writer); } + @Override + public RequestWriter getRequestWriter() { + return httpClient.getRequestWriter(); + } + @Override public void setQueryParams(Set queryParams) { super.setQueryParams(queryParams); @@ -258,4 +297,18 @@ public void onFailure(Throwable oe) { } }); } + + public static class Builder { + private final Http2SolrClient http2Client; + private final String[] baseSolrUrls; + + public Builder(Http2SolrClient http2Client, String... baseSolrUrls) { + this.http2Client = http2Client; + this.baseSolrUrls = baseSolrUrls; + } + + public LBHttp2SolrClient build() { + return new LBHttp2SolrClient(this.http2Client, Arrays.asList(this.baseSolrUrls)); + } + } } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java index cdd3c093681..47cb2c58745 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrClient.java @@ -119,6 +119,12 @@ protected HttpSolrClient makeSolrClient(String server) { if (soTimeout != null) { httpSolrClientBuilder.withSocketTimeout(soTimeout); } + if (requestWriter != null) { + httpSolrClientBuilder.withRequestWriter(requestWriter); + } + if (queryParams != null) { + httpSolrClientBuilder.withQueryParams(queryParams); + } client = httpSolrClientBuilder.build(); } } else { @@ -130,14 +136,15 @@ protected HttpSolrClient makeSolrClient(String server) { if (soTimeout != null) { clientBuilder.withSocketTimeout(soTimeout); } + if (requestWriter != null) { + clientBuilder.withRequestWriter(requestWriter); + } + if (queryParams != null) { + clientBuilder.withQueryParams(queryParams); + } client = clientBuilder.build(); } - if (requestWriter != null) { - client.setRequestWriter(requestWriter); - } - if (queryParams != null) { - client.setQueryParams(queryParams); - } + return client; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java index c85c8061d35..5086cb2377c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBSolrClient.java @@ -512,7 +512,9 @@ public ResponseParser getParser() { * @param parser Default Response Parser chosen to parse the response if the parser were not * specified as part of the request. * @see org.apache.solr.client.solrj.SolrRequest#getResponseParser() + * @deprecated Pass in a configured {@link SolrClient} instead */ + @Deprecated public void setParser(ResponseParser parser) { this.parser = parser; } @@ -521,7 +523,9 @@ public void setParser(ResponseParser parser) { * Changes the {@link RequestWriter} that will be used for the internal SolrServer objects. * * @param requestWriter Default RequestWriter, used to encode requests sent to the server. + * @deprecated Pass in a configured {@link SolrClient} instead */ + @Deprecated public void setRequestWriter(RequestWriter requestWriter) { this.requestWriter = requestWriter; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientBuilder.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientBuilder.java index 8a9ec986d8b..43e6ba0e967 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientBuilder.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientBuilder.java @@ -16,9 +16,11 @@ */ package org.apache.solr.client.solrj.impl; +import java.util.Set; import org.apache.http.client.HttpClient; import org.apache.solr.client.solrj.ResponseParser; import org.apache.solr.client.solrj.impl.HttpSolrClient.Builder; +import org.apache.solr.client.solrj.request.RequestWriter; /** * @deprecated Please look into using Solr's new Http2 clients @@ -28,8 +30,12 @@ public abstract class SolrClientBuilder> { protected HttpClient httpClient; protected ResponseParser responseParser; + protected RequestWriter requestWriter; + protected boolean useMultiPartPost; protected Integer connectionTimeoutMillis = 15000; protected Integer socketTimeoutMillis = 120000; + protected boolean followRedirects = false; + protected Set queryParams; /** The solution for the unchecked cast warning. */ public abstract B getThis(); @@ -46,6 +52,34 @@ public B withResponseParser(ResponseParser responseParser) { return getThis(); } + /** Provides a {@link RequestWriter} for created clients to use when handing requests. */ + public B withRequestWriter(RequestWriter requestWriter) { + this.requestWriter = requestWriter; + return getThis(); + } + + /** Enables or disables splitting POST requests into pieces. */ + public B allowMultiPartPost(Boolean useMultiPartPost) { + this.useMultiPartPost = useMultiPartPost; + return getThis(); + } + + /** + * Provides a set of keys which the created client will send as a part of the query string. + * + * @param queryParams set of param keys to only send via the query string Note that the param will + * be sent as a query string if the key is part of this Set or the SolrRequest's query params. + */ + public B withQueryParams(Set queryParams) { + this.queryParams = queryParams; + return getThis(); + } + + public B withFollowRedirects(boolean followRedirects) { + this.followRedirects = followRedirects; + return getThis(); + } + /** * Tells {@link Builder} that created clients should obey the following timeout when connecting to * Solr servers. diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryHttp2Test.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryHttp2Test.java index ab09f57ce9a..e5a1008e081 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryHttp2Test.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryHttp2Test.java @@ -23,7 +23,10 @@ import org.apache.solr.client.solrj.impl.Http2SolrClient; import org.junit.BeforeClass; -/** A subclass of SolrExampleTests that explicitly uses the binary codec for communication. */ +/** + * A subclass of SolrExampleTests that explicitly uses the HTTP2 client and the binary codec for + * communication. + */ @SolrTestCaseJ4.SuppressSSL(bugUrl = "https://issues.apache.org/jira/browse/SOLR-5776") public class SolrExampleBinaryHttp2Test extends SolrExampleTests { @@ -34,19 +37,11 @@ public static void beforeTest() throws Exception { @Override public SolrClient createNewSolrClient() { - try { - // setup the server... - String url = jetty.getBaseUrl().toString() + "/collection1"; - Http2SolrClient client = - new Http2SolrClient.Builder(url).connectionTimeout(DEFAULT_CONNECTION_TIMEOUT).build(); - - // where the magic happens - client.setParser(new BinaryResponseParser()); - client.setRequestWriter(new BinaryRequestWriter()); - - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } + return new Http2SolrClient.Builder(getServerUrl()) + .connectionTimeout(DEFAULT_CONNECTION_TIMEOUT) + .withRequestWriter(new BinaryRequestWriter()) + // where the magic happens + .withResponseParser(new BinaryResponseParser()) + .build(); } } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java index f7477886075..e7c58b8ea4a 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java @@ -22,7 +22,10 @@ import org.apache.solr.client.solrj.impl.HttpSolrClient; import org.junit.BeforeClass; -/** A subclass of SolrExampleTests that explicitly uses the binary codec for communication. */ +/** + * A subclass of SolrExampleTests that explicitly uses the HTTP1 client and the binary codec for + * communication. + */ @SuppressSSL(bugUrl = "https://issues.apache.org/jira/browse/SOLR-5776") public class SolrExampleBinaryTest extends SolrExampleTests { @BeforeClass @@ -32,19 +35,10 @@ public static void beforeTest() throws Exception { @Override public SolrClient createNewSolrClient() { - try { - // setup the server... - String url = jetty.getBaseUrl().toString() + "/collection1"; - HttpSolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT); - client.setUseMultiPartPost(random().nextBoolean()); - - // where the magic happens - client.setParser(new BinaryResponseParser()); - client.setRequestWriter(new BinaryRequestWriter()); - - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } + return new HttpSolrClient.Builder(getServerUrl()) + .allowMultiPartPost(random().nextBoolean()) + .withRequestWriter(new BinaryRequestWriter()) + .withResponseParser(new BinaryResponseParser()) + .build(); } } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java index e6df8d74a36..4f7d41f4fbc 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java @@ -599,25 +599,9 @@ public void testUnicode() throws Exception { Random random = random(); int numIterations = atLeast(3); - SolrClient client = getSolrClient(); - - // save the old parser, so we can set it back. - ResponseParser oldParser = null; - if (client instanceof HttpSolrClient) { - HttpSolrClient httpSolrClient = (HttpSolrClient) client; - oldParser = httpSolrClient.getParser(); - } + try (SolrClient client = getSolrClient()) { - try { for (int iteration = 0; iteration < numIterations; iteration++) { - // choose format - if (client instanceof HttpSolrClient) { - if (random.nextBoolean()) { - ((HttpSolrClient) client).setParser(new BinaryResponseParser()); - } else { - ((HttpSolrClient) client).setParser(new XMLResponseParser()); - } - } int numDocs = TestUtil.nextInt(random(), 1, 10 * RANDOM_MULTIPLIER); @@ -648,11 +632,6 @@ public void testUnicode() throws Exception { assertEquals(expected, actual); } } - } finally { - if (oldParser != null) { - // set the old parser back - ((HttpSolrClient) client).setParser(oldParser); - } } } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java index e45d70a4050..de312169ba6 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleXMLTest.java @@ -22,7 +22,10 @@ import org.apache.solr.client.solrj.request.RequestWriter; import org.junit.BeforeClass; -/** A subclass of SolrExampleTests that explicitly uses the xml codec for communication. */ +/** + * A subclass of SolrExampleTests that explicitly uses the HTTP1 client and the xml codec for + * communication. + */ @SuppressSSL(bugUrl = "https://issues.apache.org/jira/browse/SOLR-5776") public class SolrExampleXMLTest extends SolrExampleTests { @BeforeClass @@ -32,15 +35,12 @@ public static void beforeTest() throws Exception { @Override public SolrClient createNewSolrClient() { - try { - String url = jetty.getBaseUrl().toString() + "/collection1"; - HttpSolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT); - client.setUseMultiPartPost(random().nextBoolean()); - client.setParser(new XMLResponseParser()); - client.setRequestWriter(new RequestWriter()); - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } + HttpSolrClient.Builder httpSolrClientBuilder = new HttpSolrClient.Builder(getServerUrl()); + httpSolrClientBuilder.allowMultiPartPost(random().nextBoolean()); + + httpSolrClientBuilder + .withRequestWriter(new RequestWriter()) + .withResponseParser(new XMLResponseParser()); + return httpSolrClientBuilder.build(); } } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java index daf9c2a677d..0a365bdedc9 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrSchemalessExampleTest.java @@ -132,20 +132,14 @@ public void testFieldMutating() throws Exception { @Override public SolrClient createNewSolrClient() { - try { - // setup the server... - String url = jetty.getBaseUrl().toString() + "/collection1"; - HttpSolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT); - client.setUseMultiPartPost(random().nextBoolean()); - - if (random().nextBoolean()) { - client.setParser(new BinaryResponseParser()); - client.setRequestWriter(new BinaryRequestWriter()); - } - - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); + HttpSolrClient.Builder httpSolrClientBuilder = new HttpSolrClient.Builder(getServerUrl()); + if (random().nextBoolean()) { + httpSolrClientBuilder + .withRequestWriter(new BinaryRequestWriter()) + .withResponseParser(new BinaryResponseParser()); } + httpSolrClientBuilder.allowMultiPartPost(random().nextBoolean()); + + return httpSolrClientBuilder.build(); } } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java b/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java index 323a8c959ef..5dd599fcd45 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java @@ -46,53 +46,60 @@ public static void beforeTest() throws Exception { @Test public void testWithXml() throws Exception { - HttpSolrClient client = (HttpSolrClient) getSolrClient(); - client.setRequestWriter(new RequestWriter()); - client.deleteByQuery("*:*"); // delete everything! - doIt(client); + try (SolrClient client = + new HttpSolrClient.Builder(getServerUrl()).withRequestWriter(new RequestWriter()).build()) { + client.deleteByQuery("*:*"); // delete everything! + doIt(client); + } } @Test public void testWithBinary() throws Exception { - HttpSolrClient client = (HttpSolrClient) getSolrClient(); - client.setRequestWriter(new BinaryRequestWriter()); - client.deleteByQuery("*:*"); // delete everything! - doIt(client); + try (SolrClient client = + new HttpSolrClient.Builder(getServerUrl()) + .withRequestWriter(new BinaryRequestWriter()) + .build()) { + client.deleteByQuery("*:*"); // delete everything! + doIt(client); + } } @Test public void testWithBinaryBean() throws Exception { - HttpSolrClient client = (HttpSolrClient) getSolrClient(); - client.setRequestWriter(new BinaryRequestWriter()); - client.deleteByQuery("*:*"); // delete everything! - final int[] counter = new int[1]; - counter[0] = 0; - client.addBeans( - new Iterator() { - - @Override - public boolean hasNext() { - return counter[0] < numdocs; - } - - @Override - public Bean next() { - Bean bean = new Bean(); - bean.id = "" + (++counter[0]); - bean.cat = "foocat"; - return bean; - } - - @Override - public void remove() { - // do nothing - } - }); - client.commit(); - SolrQuery query = new SolrQuery("*:*"); - QueryResponse response = client.query(query); - assertEquals(0, response.getStatus()); - assertEquals(numdocs, response.getResults().getNumFound()); + try (SolrClient client = + new HttpSolrClient.Builder(getServerUrl()) + .withRequestWriter(new BinaryRequestWriter()) + .build()) { + client.deleteByQuery("*:*"); // delete everything! + final int[] counter = new int[1]; + counter[0] = 0; + client.addBeans( + new Iterator() { + + @Override + public boolean hasNext() { + return counter[0] < numdocs; + } + + @Override + public Bean next() { + Bean bean = new Bean(); + bean.id = "" + (++counter[0]); + bean.cat = "foocat"; + return bean; + } + + @Override + public void remove() { + // do nothing + } + }); + client.commit(); + SolrQuery query = new SolrQuery("*:*"); + QueryResponse response = client.query(query); + assertEquals(0, response.getStatus()); + assertEquals(numdocs, response.getResults().getNumFound()); + } } public static class Bean { @@ -100,7 +107,7 @@ public static class Bean { @Field String cat; } - private void doIt(HttpSolrClient client) throws SolrServerException, IOException { + private void doIt(SolrClient client) throws SolrServerException, IOException { final int[] counter = new int[1]; counter[0] = 0; client.add( diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttp2SolrClient.java b/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttp2SolrClient.java index aed75ba65a4..e74936e39f4 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttp2SolrClient.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttp2SolrClient.java @@ -161,7 +161,7 @@ public void testSimple() throws Exception { } private LBHttp2SolrClient getLBHttp2SolrClient(Http2SolrClient httpClient, String... s) { - return new LBHttp2SolrClient(httpClient, s); + return new LBHttp2SolrClient.Builder(httpClient, s).build(); } public void testTwoServers() throws Exception { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java b/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java index ab7840a1a35..eb2470fa4d8 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java @@ -102,18 +102,23 @@ public void showExceptions() throws Exception { @Test public void testWithXml() throws Exception { - HttpSolrClient client = (HttpSolrClient) getSolrClient(); - client.setRequestWriter(new RequestWriter()); - client.deleteByQuery("*:*"); // delete everything! - doIt(client); + try (SolrClient client = + new HttpSolrClient.Builder(getServerUrl()).withRequestWriter(new RequestWriter()).build()) { + + client.deleteByQuery("*:*"); // delete everything! + doIt(client); + } } @Test public void testWithBinary() throws Exception { - HttpSolrClient client = (HttpSolrClient) getSolrClient(); - client.setRequestWriter(new BinaryRequestWriter()); - client.deleteByQuery("*:*"); // delete everything! - doIt(client); + try (SolrClient client = + new HttpSolrClient.Builder(getServerUrl()) + .withRequestWriter(new BinaryRequestWriter()) + .build()) { + client.deleteByQuery("*:*"); // delete everything! + doIt(client); + } } Iterator manyDocs(final int base, final int numDocs) { @@ -146,7 +151,7 @@ public void remove() {} } ; - void doThreads(final HttpSolrClient client, final int numThreads, final int numRequests) + void doThreads(final SolrClient client, final int numThreads, final int numRequests) throws Exception { final AtomicInteger tries = new AtomicInteger(0); @@ -191,7 +196,7 @@ public void run() { assertTrue("got unexpected exceptions. ", unexpected.isEmpty()); } - int getCount(HttpSolrClient client) throws IOException, SolrServerException { + int getCount(SolrClient client) throws IOException, SolrServerException { client.commit(); QueryResponse rsp = client.query(params("q", "id:test", "fl", "count_i", "wt", "json")); int count = ((Number) rsp.getResults().get(0).get("count_i")).intValue(); @@ -199,13 +204,13 @@ int getCount(HttpSolrClient client) throws IOException, SolrServerException { } // this always failed with the Jetty 9.3 snapshot - void doIt(HttpSolrClient client) throws Exception { + void doIt(SolrClient client) throws Exception { client.deleteByQuery("*:*"); doThreads(client, 10, 100); // doSingle(client, 1); } - void doSingle(HttpSolrClient client, int threadNum) { + void doSingle(SolrClient client, int threadNum) { try { client.add(manyDocs(threadNum * 1000000, 1000)); } catch (BaseHttpSolrClient.RemoteSolrException e) { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java index 09a37dd01f1..d5e26aeb71c 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleJettyTest.java @@ -20,15 +20,11 @@ import java.io.ByteArrayInputStream; import java.io.IOException; -import java.io.InputStream; import java.lang.invoke.MethodHandles; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.IntStream; -import org.apache.commons.io.IOUtils; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; @@ -38,15 +34,11 @@ import org.apache.solr.client.solrj.SolrExampleTests; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrServerException; -import org.apache.solr.client.solrj.impl.BinaryResponseParser; import org.apache.solr.client.solrj.impl.HttpClientUtil; -import org.apache.solr.client.solrj.impl.HttpSolrClient; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.SolrDocument; import org.apache.solr.common.SolrInputDocument; -import org.apache.solr.common.util.NamedList; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,45 +58,45 @@ public static void beforeTest() throws Exception { @Test public void testBadSetup() { - // setup the server... String url = "http" + (isSSLMode() ? "s" : "") + "://127.0.0.1/?core=xxx"; - expectThrows(Exception.class, () -> getHttpSolrClient(url)); + // This test does NOT fail for Http2SolrClient + expectThrows(Exception.class, () -> getHttp1SolrClient(url)); } @Test public void testArbitraryJsonIndexing() throws Exception { - SolrClient client = getSolrClient(); - client.deleteByQuery("*:*"); - client.commit(); - assertNumFound("*:*", 0); // make sure it got in - - // two docs, one with uniqueKey, another without it - String json = "{\"id\":\"abc1\", \"name\": \"name1\"} {\"name\" : \"name2\"}"; - HttpClient httpClient = getHttpClient(); - HttpPost post = - new HttpPost( - getRandomizedUpdateUri(jetty.getBaseUrl() + "/" + DEFAULT_TEST_COLLECTION_NAME)); - post.setHeader("Content-Type", "application/json"); - post.setEntity( - new InputStreamEntity(new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)), -1)); - HttpResponse response = - httpClient.execute(post, HttpClientUtil.createNewHttpClientRequestContext()); - assertEquals(200, response.getStatusLine().getStatusCode()); - client.commit(); - QueryResponse rsp = getSolrClient().query(new SolrQuery("*:*")); - assertEquals(2, rsp.getResults().getNumFound()); - - SolrDocument doc = rsp.getResults().get(0); - String src = (String) doc.getFieldValue("_src_"); - @SuppressWarnings({"rawtypes"}) - Map m = (Map) fromJSONString(src); - assertEquals("abc1", m.get("id")); - assertEquals("name1", m.get("name")); - - doc = rsp.getResults().get(1); - src = (String) doc.getFieldValue("_src_"); - m = (Map) fromJSONString(src); - assertEquals("name2", m.get("name")); + try (SolrClient client = getSolrClient()) { + client.deleteByQuery("*:*"); + client.commit(); + assertNumFound("*:*", 0); // make sure it got in + + // two docs, one with uniqueKey, another without it + String json = "{\"id\":\"abc1\", \"name\": \"name1\"} {\"name\" : \"name2\"}"; + HttpClient httpClient = getHttpClient(getServerUrl()); + HttpPost post = new HttpPost(getRandomizedUpdateUri(getServerUrl())); + post.setHeader("Content-Type", "application/json"); + post.setEntity( + new InputStreamEntity( + new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)), -1)); + HttpResponse response = + httpClient.execute(post, HttpClientUtil.createNewHttpClientRequestContext()); + assertEquals(200, response.getStatusLine().getStatusCode()); + client.commit(); + QueryResponse rsp = getSolrClient().query(new SolrQuery("*:*")); + assertEquals(2, rsp.getResults().getNumFound()); + + SolrDocument doc = rsp.getResults().get(0); + String src = (String) doc.getFieldValue("_src_"); + @SuppressWarnings({"rawtypes"}) + Map m = (Map) fromJSONString(src); + assertEquals("abc1", m.get("id")); + assertEquals("name1", m.get("name")); + + doc = rsp.getResults().get(1); + src = (String) doc.getFieldValue("_src_"); + m = (Map) fromJSONString(src); + assertEquals("name2", m.get("name")); + } } private String getRandomizedUpdateUri(String baseUrl) { @@ -120,72 +112,22 @@ public void testUtf8PerfDegradation() throws Exception { doc.addField("id", "1"); doc.addField("b_is", IntStream.range(0, 30000).boxed().collect(Collectors.toList())); - HttpSolrClient client = (HttpSolrClient) getSolrClient(); - client.add(doc); - client.commit(); - long start = System.nanoTime(); - QueryResponse rsp = client.query(new SolrQuery("*:*")); - System.out.println("time taken : " + ((System.nanoTime() - start)) / (1000 * 1000)); - assertEquals(1, rsp.getResults().getNumFound()); - } - - @Ignore - public void testUtf8QueryPerf() throws Exception { - HttpSolrClient client = (HttpSolrClient) getSolrClient(); - client.deleteByQuery("*:*"); - client.commit(); - List docs = new ArrayList<>(); - for (int i = 0; i < 10; i++) { - SolrInputDocument doc2 = new SolrInputDocument(); - doc2.addField("id", "" + i); - doc2.addField("fld1_s", "1 value 1 value 1 value 1 value 1 value 1 value 1 value "); - doc2.addField( - "fld2_s", - "2 value 2 value 2 value 2 value 2 value 2 value 2 value 2 value 2 value 2 value "); - doc2.addField( - "fld3_s", - "3 value 3 value 3 value 3 value 3 value 3 value 3 value 3 value 3 value 3 value 3 value 3 value 3 value 3 value "); - doc2.addField( - "fld4_s", "4 value 4 value 4 value 4 value 4 value 4 value 4 value 4 value 4 value "); - doc2.addField( - "fld5_s", - "5 value 5 value 5 value 5 value 5 value 5 value 5 value 5 value 5 value 5 value 5 value 5 value "); - docs.add(doc2); + try (SolrClient client = getSolrClient()) { + client.add(doc); + client.commit(); + long start = System.nanoTime(); + QueryResponse rsp = client.query(new SolrQuery("*:*")); + System.out.println("time taken : " + ((System.nanoTime() - start)) / (1000 * 1000)); + assertEquals(1, rsp.getResults().getNumFound()); } - client.add(docs); - client.commit(); - QueryResponse rsp = client.query(new SolrQuery("*:*")); - assertEquals(10, rsp.getResults().getNumFound()); - - client.setParser( - new BinaryResponseParser() { - @Override - public NamedList processResponse(InputStream body, String encoding) { - try { - IOUtils.skip(body, 1024 * 1000); - } catch (IOException e) { - log.error("error skipping body", e); - } - return rsp.getResponse(); - } - }); - - runQueries(client, 1000, true); - /*BinaryResponseWriter.useUtf8CharSeq = false; - System.out.println("BinaryResponseWriter.useUtf8CharSeq = " + BinaryResponseWriter.useUtf8CharSeq); - runQueries(client, 10000, false); - BinaryResponseWriter.useUtf8CharSeq = true; - System.out.println("BinaryResponseWriter.useUtf8CharSeq = " + BinaryResponseWriter.useUtf8CharSeq);*/ - runQueries(client, 10000, false); } - private void runQueries(HttpSolrClient client, int count, boolean warmup) + private void runQueries(SolrClient client, int count, boolean warmup) throws SolrServerException, IOException { long start = System.nanoTime(); for (int i = 0; i < count; i++) { client.query(new SolrQuery("*:*")); } if (warmup) return; - System.out.println("time taken : " + ((System.nanoTime() - start)) / (1000 * 1000)); } } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryHttp2Test.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryHttp2Test.java index 70dbc358f36..32f49d2c69c 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryHttp2Test.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryHttp2Test.java @@ -37,12 +37,13 @@ public class SolrExampleStreamingBinaryHttp2Test extends SolrExampleStreamingHtt @Override public SolrClient createNewSolrClient() { - // setup the server... String url = jetty.getBaseUrl().toString() + "/collection1"; // smaller queue size hits locks more often - Http2SolrClient solrClient = new Http2SolrClient.Builder().build(); - solrClient.setParser(new BinaryResponseParser()); - solrClient.setRequestWriter(new BinaryRequestWriter()); + Http2SolrClient solrClient = + new Http2SolrClient.Builder() + .withRequestWriter(new BinaryRequestWriter()) + .withResponseParser(new BinaryResponseParser()) + .build(); ConcurrentUpdateHttp2SolrClient concurrentClient = new ErrorTrackingConcurrentUpdateSolrClient.Builder(url, solrClient) .withQueueSize(2) diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryTest.java index aae29ac8533..77310ff3055 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingBinaryTest.java @@ -24,7 +24,6 @@ import org.apache.solr.client.solrj.StreamingResponseCallback; import org.apache.solr.client.solrj.impl.BinaryRequestWriter; import org.apache.solr.client.solrj.impl.BinaryResponseParser; -import org.apache.solr.client.solrj.impl.ConcurrentUpdateSolrClient; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.SolrDocument; import org.apache.solr.common.SolrInputDocument; @@ -35,9 +34,15 @@ public class SolrExampleStreamingBinaryTest extends SolrExampleStreamingTest { @Override public SolrClient createNewSolrClient() { - ConcurrentUpdateSolrClient client = (ConcurrentUpdateSolrClient) super.createNewSolrClient(); - client.setParser(new BinaryResponseParser()); - client.setRequestWriter(new BinaryRequestWriter()); + + SolrClient client = + new ErrorTrackingConcurrentUpdateSolrClient.Builder(getServerUrl()) + .withQueueSize(2) + .withThreadCount(5) + .withResponseParser(new BinaryResponseParser()) + .withRequestWriter(new BinaryRequestWriter()) + .build(); + return client; } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingHttp2Test.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingHttp2Test.java index 9a3b12aa61d..2939832c7d4 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingHttp2Test.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingHttp2Test.java @@ -31,6 +31,10 @@ import org.apache.solr.common.SolrInputDocument; import org.junit.BeforeClass; +/** + * A subclass of SolrExampleTests that explicitly uses the HTTP2 client and the streaming update + * client for communication. + */ public class SolrExampleStreamingHttp2Test extends SolrExampleTests { @BeforeClass @@ -40,12 +44,13 @@ public static void beforeTest() throws Exception { @Override public SolrClient createNewSolrClient() { - // setup the server... String url = jetty.getBaseUrl().toString() + "/collection1"; // smaller queue size hits locks more often - Http2SolrClient solrClient = new Http2SolrClient.Builder().build(); - solrClient.setParser(new XMLResponseParser()); - solrClient.setRequestWriter(new RequestWriter()); + Http2SolrClient solrClient = + new Http2SolrClient.Builder() + .withRequestWriter(new RequestWriter()) + .withResponseParser(new XMLResponseParser()) + .build(); ConcurrentUpdateHttp2SolrClient concurrentClient = new ErrorTrackingConcurrentUpdateSolrClient.Builder(url, solrClient) .withQueueSize(2) diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java index b445d763948..3c82ef40fdc 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleStreamingTest.java @@ -30,7 +30,8 @@ import org.junit.BeforeClass; /** - * @since solr 1.3 + * A subclass of SolrExampleTests that explicitly uses the HTTP1 client and the streaming update + * client for communication. */ public class SolrExampleStreamingTest extends SolrExampleTests { @@ -41,21 +42,13 @@ public static void beforeTest() throws Exception { @Override public SolrClient createNewSolrClient() { - try { - // setup the server... - String url = jetty.getBaseUrl().toString() + "/collection1"; - // smaller queue size hits locks more often - ConcurrentUpdateSolrClient concurrentClient = - new ErrorTrackingConcurrentUpdateSolrClient.Builder(url) - .withQueueSize(2) - .withThreadCount(5) - .build(); - concurrentClient.setParser(new XMLResponseParser()); - concurrentClient.setRequestWriter(new RequestWriter()); - return concurrentClient; - } catch (Exception ex) { - throw new RuntimeException(ex); - } + // smaller queue size hits locks more often + return new ErrorTrackingConcurrentUpdateSolrClient.Builder(getServerUrl()) + .withQueueSize(2) + .withThreadCount(5) + .withResponseParser(new XMLResponseParser()) + .withRequestWriter(new RequestWriter()) + .build(); } public void testWaitOptions() throws Exception { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleXMLHttp2Test.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleXMLHttp2Test.java index 0ced44f8352..94c8789fb77 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleXMLHttp2Test.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/SolrExampleXMLHttp2Test.java @@ -24,6 +24,10 @@ import org.apache.solr.client.solrj.request.RequestWriter; import org.junit.BeforeClass; +/** + * A subclass of SolrExampleTests that explicitly uses the HTTP2 client and the xml codec for + * communication. + */ public class SolrExampleXMLHttp2Test extends SolrExampleTests { @BeforeClass public static void beforeTest() throws Exception { @@ -32,15 +36,13 @@ public static void beforeTest() throws Exception { @Override public SolrClient createNewSolrClient() { - try { - String url = jetty.getBaseUrl().toString() + "/collection1"; - Http2SolrClient client = - new Http2SolrClient.Builder(url).connectionTimeout(DEFAULT_CONNECTION_TIMEOUT).build(); - client.setParser(new XMLResponseParser()); - client.setRequestWriter(new RequestWriter()); - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } + + Http2SolrClient client = + new Http2SolrClient.Builder(getServerUrl()) + .connectionTimeout(DEFAULT_CONNECTION_TIMEOUT) + .withRequestWriter(new RequestWriter()) + .withResponseParser(new XMLResponseParser()) + .build(); + return client; } } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java index a2bf198184b..c59085bb0e6 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java @@ -242,9 +242,11 @@ public void testSolrExceptionCodeNotFromSolr() throws IOException, SolrServerExc @Test public void testQuery() throws Exception { DebugServlet.clear(); - try (HttpSolrClient client = getHttpSolrClient(jetty.getBaseUrl().toString() + "/debug/foo")) { - SolrQuery q = new SolrQuery("foo"); - q.setParam("a", "\u1234"); + String url = jetty.getBaseUrl().toString() + "/debug/foo"; + SolrQuery q = new SolrQuery("foo"); + q.setParam("a", "\u1234"); + try (HttpSolrClient client = getHttpSolrClient(url)) { + expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.query(q, METHOD.GET)); // default method @@ -318,9 +320,12 @@ public void testQuery() throws Exception { assertEquals( "application/x-www-form-urlencoded; charset=UTF-8", DebugServlet.headers.get("Content-Type")); + } + // XML + try (HttpSolrClient client = + new HttpSolrClient.Builder(url).withResponseParser(new XMLResponseParser()).build()) { // XML/GET - client.setParser(new XMLResponseParser()); DebugServlet.clear(); expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.query(q, METHOD.GET)); @@ -341,7 +346,6 @@ public void testQuery() throws Exception { assertEquals("keep-alive", DebugServlet.headers.get("Connection")); // XML/POST - client.setParser(new XMLResponseParser()); DebugServlet.clear(); expectThrows( BaseHttpSolrClient.RemoteSolrException.class, () -> client.query(q, METHOD.POST)); @@ -365,7 +369,6 @@ public void testQuery() throws Exception { "application/x-www-form-urlencoded; charset=UTF-8", DebugServlet.headers.get("Content-Type")); - client.setParser(new XMLResponseParser()); DebugServlet.clear(); expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.query(q, METHOD.PUT)); @@ -393,7 +396,8 @@ public void testQuery() throws Exception { @Test public void testDelete() throws Exception { DebugServlet.clear(); - try (HttpSolrClient client = getHttpSolrClient(jetty.getBaseUrl().toString() + "/debug/foo")) { + String url = jetty.getBaseUrl().toString() + "/debug/foo"; + try (HttpSolrClient client = getHttpSolrClient(url)) { expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.deleteById("id")); // default method @@ -415,9 +419,11 @@ public void testDelete() throws Exception { DebugServlet.headers.get("User-Agent")); // keepalive assertEquals("keep-alive", DebugServlet.headers.get("Connection")); + } - // XML - client.setParser(new XMLResponseParser()); + // XML + try (HttpSolrClient client = + new HttpSolrClient.Builder(url).withResponseParser(new XMLResponseParser()).build()) { expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.deleteByQuery("*:*")); assertEquals("post", DebugServlet.lastMethod); @@ -452,7 +458,9 @@ public void testGetById() throws Exception { @Test public void testUpdate() throws Exception { DebugServlet.clear(); - try (HttpSolrClient client = getHttpSolrClient(jetty.getBaseUrl().toString() + "/debug/foo")) { + String url = jetty.getBaseUrl().toString() + "/debug/foo"; + + try (HttpSolrClient client = getHttpSolrClient(url)) { UpdateRequest req = new UpdateRequest(); req.add(new SolrInputDocument()); req.setParam("a", "\u1234"); @@ -476,10 +484,18 @@ public void testUpdate() throws Exception { // parameter encoding assertEquals(1, DebugServlet.parameters.get("a").length); assertEquals("\u1234", DebugServlet.parameters.get("a")[0]); + } + DebugServlet.clear(); + // XML response and writer + try (HttpSolrClient client = + new HttpSolrClient.Builder(url) + .withRequestWriter(new RequestWriter()) + .withResponseParser(new XMLResponseParser()) + .build()) { + UpdateRequest req = new UpdateRequest(); + req.add(new SolrInputDocument()); + req.setParam("a", "\u1234"); - // XML response and writer - client.setParser(new XMLResponseParser()); - client.setRequestWriter(new RequestWriter()); expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.request(req)); assertEquals("post", DebugServlet.lastMethod); @@ -494,11 +510,18 @@ public void testUpdate() throws Exception { assertEquals("application/xml; charset=UTF-8", DebugServlet.headers.get("Content-Type")); assertEquals(1, DebugServlet.parameters.get("a").length); assertEquals("\u1234", DebugServlet.parameters.get("a")[0]); + } + DebugServlet.clear(); + // javabin request + try (HttpSolrClient client = + new HttpSolrClient.Builder(url) + .withRequestWriter(new BinaryRequestWriter()) + .withResponseParser(new BinaryResponseParser()) + .build()) { + UpdateRequest req = new UpdateRequest(); + req.add(new SolrInputDocument()); + req.setParam("a", "\u1234"); - // javabin request - client.setParser(new BinaryResponseParser()); - client.setRequestWriter(new BinaryRequestWriter()); - DebugServlet.clear(); expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.request(req)); assertEquals("post", DebugServlet.lastMethod); @@ -760,38 +783,38 @@ private void verifyServletState(HttpSolrClient client, SolrRequest request) { public void testQueryString() throws Exception { final String clientUrl = jetty.getBaseUrl().toString() + "/debug/foo"; - try (HttpSolrClient client = getHttpSolrClient(clientUrl)) { + HttpSolrClient.Builder builder = new HttpSolrClient.Builder(clientUrl); + try (HttpSolrClient client = builder.withQueryParams(setOf("serverOnly")).build()) { // test without request query params DebugServlet.clear(); - client.setQueryParams(setOf("serverOnly")); UpdateRequest req = new UpdateRequest(); setReqParamsOf(req, "serverOnly", "notServer"); expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.request(req)); verifyServletState(client, req); - + } + try (HttpSolrClient client = builder.withQueryParams(setOf()).build()) { // test without server query params DebugServlet.clear(); - client.setQueryParams(setOf()); UpdateRequest req2 = new UpdateRequest(); req2.setQueryParams(setOf("requestOnly")); setReqParamsOf(req2, "requestOnly", "notRequest"); expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.request(req2)); verifyServletState(client, req2); - + } + try (HttpSolrClient client = builder.withQueryParams(setOf("serverOnly", "both")).build()) { // test with both request and server query params DebugServlet.clear(); UpdateRequest req3 = new UpdateRequest(); - client.setQueryParams(setOf("serverOnly", "both")); req3.setQueryParams(setOf("requestOnly", "both")); setReqParamsOf(req3, "serverOnly", "requestOnly", "both", "neither"); expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.request(req3)); verifyServletState(client, req3); - + } + try (HttpSolrClient client = builder.withQueryParams(setOf("serverOnly", "both")).build()) { // test with both request and server query params with single stream DebugServlet.clear(); UpdateRequest req4 = new UpdateRequest(); req4.add(new SolrInputDocument()); - client.setQueryParams(setOf("serverOnly", "both")); req4.setQueryParams(setOf("requestOnly", "both")); setReqParamsOf(req4, "serverOnly", "requestOnly", "both", "neither"); expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> client.request(req4)); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientTest.java index 845eff9d049..ab7a3a7ef86 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClientTest.java @@ -156,10 +156,9 @@ public void testConcurrentUpdate() throws Exception { serverUrl, successCounter, errorCounter, errors) .withQueueSize(cussQueueSize) .withThreadCount(cussThreadCount) + .withPollQueueTime(0) .build(); - concurrentClient.setPollQueueTime(0); - // ensure it doesn't block where there's nothing to do yet concurrentClient.blockUntilFinished(); @@ -251,8 +250,8 @@ public void testConcurrentCollectionUpdate() throws Exception { (new ConcurrentUpdateSolrClient.Builder(jetty.getBaseUrl().toString())) .withQueueSize(cussQueueSize) .withThreadCount(cussThreadCount) + .withPollQueueTime(0) .build()) { - concurrentClient.setPollQueueTime(0); // ensure it doesn't block where there's nothing to do yet concurrentClient.blockUntilFinished(); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java index 1dce0dc06cc..d53b86c45f9 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java @@ -196,10 +196,6 @@ private Http2SolrClient.Builder getHttp2SolrClient( .idleTimeout(socketTimeout); } - private Http2SolrClient getHttp2SolrClient(String url) { - return new Http2SolrClient.Builder(url).build(); - } - @Test public void testTimeout() throws Exception { SolrQuery q = new SolrQuery("*:*"); @@ -274,10 +270,11 @@ public void testSolrExceptionCodeNotFromSolr() throws IOException, SolrServerExc @Test public void testQuery() throws Exception { DebugServlet.clear(); - try (Http2SolrClient client = - getHttp2SolrClient(jetty.getBaseUrl().toString() + "/debug/foo")) { - SolrQuery q = new SolrQuery("foo"); - q.setParam("a", "\u1234"); + String url = jetty.getBaseUrl().toString() + "/debug/foo"; + SolrQuery q = new SolrQuery("foo"); + q.setParam("a", "\u1234"); + try (Http2SolrClient client = getHttp2SolrClient(url)) { + try { client.query(q, SolrRequest.METHOD.GET); } catch (BaseHttpSolrClient.RemoteSolrException ignored) { @@ -339,9 +336,11 @@ public void testQuery() throws Exception { assertEquals("\u1234", DebugServlet.parameters.get("a")[0]); assertEquals(EXPECTED_USER_AGENT, DebugServlet.headers.get("user-agent")); assertEquals("application/x-www-form-urlencoded", DebugServlet.headers.get("content-type")); + } + // XML/GET + try (Http2SolrClient client = + new Http2SolrClient.Builder(url).withResponseParser(new XMLResponseParser()).build()) { - // XML/GET - client.setParser(new XMLResponseParser()); DebugServlet.clear(); try { client.query(q, SolrRequest.METHOD.GET); @@ -360,7 +359,6 @@ public void testQuery() throws Exception { assertEquals(EXPECTED_USER_AGENT, DebugServlet.headers.get("user-agent")); // XML/POST - client.setParser(new XMLResponseParser()); DebugServlet.clear(); try { client.query(q, SolrRequest.METHOD.POST); @@ -379,7 +377,6 @@ public void testQuery() throws Exception { assertEquals(EXPECTED_USER_AGENT, DebugServlet.headers.get("user-agent")); assertEquals("application/x-www-form-urlencoded", DebugServlet.headers.get("content-type")); - client.setParser(new XMLResponseParser()); DebugServlet.clear(); try { client.query(q, SolrRequest.METHOD.PUT); @@ -403,8 +400,8 @@ public void testQuery() throws Exception { @Test public void testDelete() throws Exception { DebugServlet.clear(); - try (Http2SolrClient client = - getHttp2SolrClient(jetty.getBaseUrl().toString() + "/debug/foo")) { + String url = jetty.getBaseUrl().toString() + "/debug/foo"; + try (Http2SolrClient client = getHttp2SolrClient(url)) { try { client.deleteById("id"); } catch (BaseHttpSolrClient.RemoteSolrException ignored) { @@ -423,9 +420,11 @@ public void testDelete() throws Exception { client.getParser().getVersion(), DebugServlet.parameters.get(CommonParams.VERSION)[0]); // agent assertEquals(EXPECTED_USER_AGENT, DebugServlet.headers.get("user-agent")); + } + // XML + try (Http2SolrClient client = + new Http2SolrClient.Builder(url).withResponseParser(new XMLResponseParser()).build()) { - // XML - client.setParser(new XMLResponseParser()); try { client.deleteByQuery("*:*"); } catch (BaseHttpSolrClient.RemoteSolrException ignored) { @@ -473,11 +472,12 @@ public void testGetById() throws Exception { @Test public void testUpdate() throws Exception { DebugServlet.clear(); - try (Http2SolrClient client = - getHttp2SolrClient(jetty.getBaseUrl().toString() + "/debug/foo")) { - UpdateRequest req = new UpdateRequest(); - req.add(new SolrInputDocument()); - req.setParam("a", "\u1234"); + String url = jetty.getBaseUrl().toString() + "/debug/foo"; + UpdateRequest req = new UpdateRequest(); + req.add(new SolrInputDocument()); + req.setParam("a", "\u1234"); + try (Http2SolrClient client = getHttp2SolrClient(url)) { + try { client.request(req); } catch (BaseHttpSolrClient.RemoteSolrException ignored) { @@ -499,10 +499,14 @@ public void testUpdate() throws Exception { // parameter encoding assertEquals(1, DebugServlet.parameters.get("a").length); assertEquals("\u1234", DebugServlet.parameters.get("a")[0]); + } + try (Http2SolrClient client = + new Http2SolrClient.Builder(url) + .withRequestWriter(new RequestWriter()) + .withResponseParser(new XMLResponseParser()) + .build()) { // XML response and writer - client.setParser(new XMLResponseParser()); - client.setRequestWriter(new RequestWriter()); try { client.request(req); } catch (BaseHttpSolrClient.RemoteSolrException ignored) { @@ -518,10 +522,15 @@ public void testUpdate() throws Exception { assertEquals("application/xml; charset=UTF-8", DebugServlet.headers.get("content-type")); assertEquals(1, DebugServlet.parameters.get("a").length); assertEquals("\u1234", DebugServlet.parameters.get("a")[0]); + } + + // javabin request + try (Http2SolrClient client = + new Http2SolrClient.Builder(url) + .withRequestWriter(new BinaryRequestWriter()) + .withResponseParser(new BinaryResponseParser()) + .build()) { - // javabin request - client.setParser(new BinaryResponseParser()); - client.setRequestWriter(new BinaryRequestWriter()); DebugServlet.clear(); try { client.request(req); @@ -542,7 +551,29 @@ public void testUpdate() throws Exception { } @Test - public void testRedirect() throws Exception { + public void testFollowRedirect() throws Exception { + final String clientUrl = jetty.getBaseUrl().toString() + "/redirect/foo"; + try (Http2SolrClient client = + new Http2SolrClient.Builder(clientUrl).withFollowRedirects(true).build()) { + SolrQuery q = new SolrQuery("*:*"); + client.query(q); + } + } + + @Test + public void testDoNotFollowRedirect() throws Exception { + final String clientUrl = jetty.getBaseUrl().toString() + "/redirect/foo"; + try (Http2SolrClient client = + new Http2SolrClient.Builder(clientUrl).withFollowRedirects(false).build()) { + SolrQuery q = new SolrQuery("*:*"); + + SolrServerException thrown = assertThrows(SolrServerException.class, () -> client.query(q)); + assertTrue(thrown.getMessage().contains("redirect")); + } + } + + @Test + public void testRedirectSwapping() throws Exception { final String clientUrl = jetty.getBaseUrl().toString() + "/redirect/foo"; try (Http2SolrClient client = getHttp2SolrClient(clientUrl)) { SolrQuery q = new SolrQuery("*:*"); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpSolrClientConPoolTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpSolrClientConPoolTest.java index fc7b037ca98..0c0812a1cf3 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpSolrClientConPoolTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpSolrClientConPoolTest.java @@ -66,23 +66,19 @@ public static void stopYetty() throws Exception { public void testPoolSize() throws SolrServerException, IOException { PoolingHttpClientConnectionManager pool = HttpClientUtil.createPoolingConnectionManager(); - final HttpSolrClient client1; - final String fooUrl; - { - fooUrl = jetty.getBaseUrl().toString() + "/" + "collection1"; - CloseableHttpClient httpClient = - HttpClientUtil.createClient( - new ModifiableSolrParams(), pool, false /* let client shutdown it*/); - client1 = getHttpSolrClient(fooUrl, httpClient, DEFAULT_CONNECTION_TIMEOUT); - } + + final String fooUrl = jetty.getBaseUrl().toString() + "/" + "collection1"; final String barUrl = yetty.getBaseUrl().toString() + "/" + "collection1"; + CloseableHttpClient httpClient = + HttpClientUtil.createClient( + new ModifiableSolrParams(), pool, false /* let client shutdown it*/); + final HttpSolrClient clientFoo = + new HttpSolrClient.Builder(fooUrl).withHttpClient(httpClient).build(); + final HttpSolrClient clientBar = + new HttpSolrClient.Builder(barUrl).withHttpClient(httpClient).build(); - { - client1.setBaseURL(fooUrl); - client1.deleteByQuery("*:*"); - client1.setBaseURL(barUrl); - client1.deleteByQuery("*:*"); - } + clientFoo.deleteByQuery("*:*"); + clientBar.deleteByQuery("*:*"); List urls = new ArrayList<>(); for (int i = 0; i < 17; i++) { @@ -97,23 +93,23 @@ public void testPoolSize() throws SolrServerException, IOException { try { int i = 0; for (String url : urls) { - if (!client1.getBaseURL().equals(url)) { - client1.setBaseURL(url); + if (clientFoo.getBaseURL().equals(url)) { + clientFoo.add(new SolrInputDocument("id", "" + (i++))); + } else { + clientBar.add(new SolrInputDocument("id", "" + (i++))); } - client1.add(new SolrInputDocument("id", "" + (i++))); } - client1.setBaseURL(fooUrl); - client1.commit(); - assertEquals(17, client1.query(new SolrQuery("*:*")).getResults().getNumFound()); - client1.setBaseURL(barUrl); - client1.commit(); - assertEquals(31, client1.query(new SolrQuery("*:*")).getResults().getNumFound()); + clientFoo.commit(); + clientBar.commit(); + + assertEquals(17, clientFoo.query(new SolrQuery("*:*")).getResults().getNumFound()); + assertEquals(31, clientBar.query(new SolrQuery("*:*")).getResults().getNumFound()); PoolStats stats = pool.getTotalStats(); assertEquals("oh " + stats, 2, stats.getAvailable()); } finally { - for (HttpSolrClient c : new HttpSolrClient[] {client1}) { + for (HttpSolrClient c : new HttpSolrClient[] {clientFoo, clientBar}) { HttpClientUtil.close(c.getHttpClient()); c.close(); } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/LBHttp2SolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/LBHttp2SolrClientTest.java index 4ac48c1918c..fa275250056 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/LBHttp2SolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/LBHttp2SolrClientTest.java @@ -20,57 +20,11 @@ import java.util.HashSet; import java.util.Set; import org.apache.solr.SolrTestCase; -import org.apache.solr.client.solrj.ResponseParser; -import org.apache.solr.client.solrj.request.RequestWriter; import org.junit.Test; /** Test the LBHttp2SolrClient. */ public class LBHttp2SolrClientTest extends SolrTestCase { - /** - * Test method for {@link LBHttp2SolrClient#setParser(ResponseParser)}. - * - *

Validate that the parser passed in is used in the base Http2SolrClient - * instance. - */ - @Test - public void testLBHttp2SolrClientSetRequestParser() throws IOException { - String url = "http://127.0.0.1:8080"; - try (Http2SolrClient http2Client = new Http2SolrClient.Builder(url).build(); - LBHttp2SolrClient testClient = new LBHttp2SolrClient(http2Client, url)) { - testClient.setParser(null); - assertNull("Generated lb client should have null parser.", testClient.getParser()); - assertNull("Generated base client should have null parser.", http2Client.getParser()); - - ResponseParser parser = new NoOpResponseParser("json"); - testClient.setParser(parser); - assertEquals("Wrong parser found in lb client.", parser, testClient.getParser()); - assertEquals("Wrong parser found in base client.", parser, http2Client.getParser()); - } - } - - /** - * Test method for {@link LBHttp2SolrClient#setRequestWriter(RequestWriter)}. - * - *

Validate that the requestWriter passed in is used in the base Http2SolrClient - * instance. - */ - @Test - public void testLBHttp2SolrClientSetRequestWriter() throws IOException { - String url = "http://127.0.0.1:8080"; - try (Http2SolrClient http2Client = new Http2SolrClient.Builder(url).build(); - LBHttp2SolrClient testClient = new LBHttp2SolrClient(http2Client, url)) { - testClient.setRequestWriter(null); - assertNull("Generated lb client should have null writer.", testClient.getRequestWriter()); - assertNull("Generated base client should have null writer.", http2Client.getRequestWriter()); - - RequestWriter writer = new BinaryRequestWriter(); - testClient.setRequestWriter(writer); - assertEquals("Wrong writer found in lb client.", writer, testClient.getRequestWriter()); - assertEquals("Wrong writer found in base client.", writer, http2Client.getRequestWriter()); - } - } - /** * Test method for {@link LBHttp2SolrClient#setQueryParams(Set)} and {@link * LBHttp2SolrClient#addQueryParams(String)}. @@ -82,7 +36,7 @@ public void testLBHttp2SolrClientSetRequestWriter() throws IOException { public void testLBHttp2SolrClientSetQueryParams() throws IOException { String url = "http://127.0.0.1:8080"; try (Http2SolrClient http2Client = new Http2SolrClient.Builder(url).build(); - LBHttp2SolrClient testClient = new LBHttp2SolrClient(http2Client, url)) { + LBHttp2SolrClient testClient = new LBHttp2SolrClient.Builder(http2Client, url).build()) { Set queryParams = new HashSet<>(2); queryParams.add("param1=this"); testClient.setQueryParams(new HashSet<>(queryParams)); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/response/NoOpResponseParserTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/response/NoOpResponseParserTest.java index b94ea62c41b..d09eb907f9a 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/response/NoOpResponseParserTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/response/NoOpResponseParserTest.java @@ -72,10 +72,12 @@ public void doBefore() throws IOException, SolrServerException { @Test public void testQueryParse() throws Exception { - try (HttpSolrClient client = (HttpSolrClient) createNewSolrClient()) { + try (SolrClient client = + new HttpSolrClient.Builder(getServerUrl()) + .withResponseParser(new NoOpResponseParser()) + .build()) { SolrQuery query = new SolrQuery("id:1234"); QueryRequest req = new QueryRequest(query); - client.setParser(new NoOpResponseParser()); NamedList resp = client.request(req); String responseString = (String) resp.get("response"); assertResponse(responseString); diff --git a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java index abd6f018a42..9711945237c 100644 --- a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java +++ b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java @@ -534,16 +534,15 @@ public SortedMap, String> getExtraRequestFilters() { } protected SolrClient createNewSolrClient(int port) { - try { - // setup the client... - String baseUrl = buildUrl(port); - if (baseUrl.endsWith("/")) { - return getHttpSolrClient(baseUrl + DEFAULT_TEST_CORENAME); - } else { - return getHttpSolrClient(baseUrl + "/" + DEFAULT_TEST_CORENAME); - } - } catch (Exception ex) { - throw new RuntimeException(ex); + return getHttpSolrClient(getServerUrl(port)); + } + + protected String getServerUrl(int port) { + String baseUrl = buildUrl(port); + if (baseUrl.endsWith("/")) { + return baseUrl + DEFAULT_TEST_CORENAME; + } else { + return baseUrl + "/" + DEFAULT_TEST_CORENAME; } } diff --git a/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java b/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java index b79d286e759..3b7c5ac32a4 100644 --- a/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java @@ -129,6 +129,10 @@ public static JettySolrRunner createAndStartJetty( return jetty; } + protected String getServerUrl() { + return jetty.getBaseUrl().toString() + "/" + DEFAULT_TEST_CORENAME; + } + @After public synchronized void afterClass() throws Exception { if (client != null) client.close(); @@ -151,19 +155,12 @@ public synchronized SolrClient getSolrClient() { } /** - * Create a new solr client. If createJetty was called, an http implementation will be created, + * Create a new solr client. If createJetty was called, a http implementation will be created, * otherwise an embedded implementation will be created. Subclasses should override for other * options. */ public SolrClient createNewSolrClient() { - try { - // setup the client... - final String url = jetty.getBaseUrl().toString() + "/" + "collection1"; - final SolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT); - return client; - } catch (final Exception ex) { - throw new RuntimeException(ex); - } + return getHttpSolrClient(getServerUrl()); } public HttpClient getHttpClient() { diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java index 43666fd3683..7caa396578b 100644 --- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java +++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java @@ -2562,20 +2562,20 @@ public static Object skewed(Object likely, Object unlikely) { * A variant of {@link org.apache.solr.client.solrj.impl.CloudHttp2SolrClient.Builder} that will * randomize some internal settings. */ - public static class CloudHttp2SolrClientBuilder extends CloudHttp2SolrClient.Builder { + public static class RandomizingCloudHttp2SolrClientBuilder extends CloudHttp2SolrClient.Builder { - public CloudHttp2SolrClientBuilder(List zkHosts, Optional zkChroot) { + public RandomizingCloudHttp2SolrClientBuilder(List zkHosts, Optional zkChroot) { super(zkHosts, zkChroot); randomizeCloudSolrClient(); } - public CloudHttp2SolrClientBuilder(ClusterStateProvider stateProvider) { + public RandomizingCloudHttp2SolrClientBuilder(ClusterStateProvider stateProvider) { super(new ArrayList<>()); this.stateProvider = stateProvider; randomizeCloudSolrClient(); } - public CloudHttp2SolrClientBuilder(MiniSolrCloudCluster cluster) { + public RandomizingCloudHttp2SolrClientBuilder(MiniSolrCloudCluster cluster) { super(new ArrayList<>()); if (random().nextBoolean()) { this.zkHosts.add(cluster.getZkServer().getZkAddress()); @@ -2610,7 +2610,7 @@ private void randomizeCloudSolrClient() { * org.apache.solr.client.solrj.impl.CloudHttp2SolrClient.Builder} class directly */ public static CloudHttp2SolrClient getCloudHttp2SolrClient(MiniSolrCloudCluster cluster) { - return new CloudHttp2SolrClientBuilder(cluster).build(); + return new RandomizingCloudHttp2SolrClientBuilder(cluster).build(); } /** @@ -2871,10 +2871,31 @@ public static LBHttpSolrClient getLBHttpSolrClient(String... solrUrls) return new LBHttpSolrClient.Builder().withBaseSolrUrls(solrUrls).build(); } + /** This method creates a HttpClient from a URL. */ + @Deprecated // We are migrating away from Apache HttpClient. + public static HttpClient getHttpClient(String url) { + return new HttpSolrClient.Builder(url).build().getHttpClient(); + } + /** - * This method may randomize unspecified aspects of the resulting SolrClient. Tests that do - * not wish to have any randomized behavior should use the {@link - * org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly + * This method creates a basic HttpSolrClient. Tests that want to control the creation process + * should use the {@link org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly + */ + public static HttpSolrClient getHttp1SolrClient(String url) { + return new HttpSolrClient.Builder(url).build(); + } + + /** + * This method creates a basic Http2SolrClient. Tests that want to control the creation process + * should use the {@link org.apache.solr.client.solrj.impl.Http2SolrClient.Builder} class directly + */ + public static Http2SolrClient getHttp2SolrClient(String url) { + return new Http2SolrClient.Builder(url).build(); + } + + /** + * This method creates a basic HttpSolrClient. Tests that want to control the creation process + * should use the {@link org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly */ public static HttpSolrClient getHttpSolrClient( String url, HttpClient httpClient, ResponseParser responseParser, boolean compression) { @@ -2886,9 +2907,8 @@ public static HttpSolrClient getHttpSolrClient( } /** - * This method may randomize unspecified aspects of the resulting SolrClient. Tests that do - * not wish to have any randomized behavior should use the {@link - * org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly + * This method creates a basic HttpSolrClient. Tests that want to control the creation process + * should use the {@link org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly */ public static HttpSolrClient getHttpSolrClient( String url, HttpClient httpClient, ResponseParser responseParser) { @@ -2896,18 +2916,16 @@ public static HttpSolrClient getHttpSolrClient( } /** - * This method may randomize unspecified aspects of the resulting SolrClient. Tests that do - * not wish to have any randomized behavior should use the {@link - * org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly + * This method creates a basic HttpSolrClient. Tests that want to control the creation process + * should use the {@link org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly */ public static HttpSolrClient getHttpSolrClient(String url, HttpClient httpClient) { return new Builder(url).withHttpClient(httpClient).build(); } /** - * This method may randomize unspecified aspects of the resulting SolrClient. Tests that do - * not wish to have any randomized behavior should use the {@link - * org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly + * This method creates a basic HttpSolrClient. Tests that want to control the creation process + * should use the {@link org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly */ public static HttpSolrClient getHttpSolrClient( String url, HttpClient httpClient, int connectionTimeoutMillis) { @@ -2918,27 +2936,24 @@ public static HttpSolrClient getHttpSolrClient( } /** - * This method may randomize unspecified aspects of the resulting SolrClient. Tests that do - * not wish to have any randomized behavior should use the {@link - * org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly + * This method creates a basic HttpSolrClient. Tests that want to control the creation process + * should use the {@link org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly */ public static HttpSolrClient getHttpSolrClient(String url) { - return new Builder(url).build(); + return new HttpSolrClient.Builder(url).build(); } /** - * This method may randomize unspecified aspects of the resulting SolrClient. Tests that do - * not wish to have any randomized behavior should use the {@link - * org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly + * This method creates a basic HttpSolrClient. Tests that want to control the creation process + * should use the {@link org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly */ public static HttpSolrClient getHttpSolrClient(String url, int connectionTimeoutMillis) { return new Builder(url).withConnectionTimeout(connectionTimeoutMillis).build(); } /** - * This method may randomize unspecified aspects of the resulting SolrClient. Tests that do - * not wish to have any randomized behavior should use the {@link - * org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly + * This method creates a basic HttpSolrClient. Tests that want to control the creation process + * should use the {@link org.apache.solr.client.solrj.impl.HttpSolrClient.Builder} class directly */ public static HttpSolrClient getHttpSolrClient( String url, int connectionTimeoutMillis, int socketTimeoutMillis) { diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java index 9d4cd98d0c5..5dfd05b91d1 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java @@ -1707,28 +1707,19 @@ private void createNewCollection(final String collection) throws InterruptedExce @Override protected SolrClient createNewSolrClient(String collection, String baseUrl) { - try { - // setup the server... - SolrClient client = getHttpSolrClient(baseUrl + "/" + collection); - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } + SolrClient client = getHttpSolrClient(baseUrl + "/" + collection); + + return client; } protected SolrClient createNewSolrClient( String collection, String baseUrl, int connectionTimeoutMillis, int socketTimeoutMillis) { - try { - // setup the server... - SolrClient client = - getHttpSolrClient( - baseUrl + "/" + collection, connectionTimeoutMillis, socketTimeoutMillis); - - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } + + SolrClient client = + getHttpSolrClient(baseUrl + "/" + collection, connectionTimeoutMillis, socketTimeoutMillis); + + return client; } @Override diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java index 40c94214935..5ff2914ffa3 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java @@ -2165,46 +2165,14 @@ protected SolrClient createNewSolrClient(int port) { return createNewSolrClient(DEFAULT_COLLECTION, port); } - protected SolrClient createNewSolrClient( - int port, int connectionTimeoutMillis, int socketTimeoutMillis) { - return createNewSolrClient( - DEFAULT_COLLECTION, port, connectionTimeoutMillis, socketTimeoutMillis); - } - protected SolrClient createNewSolrClient(String coreName, int port) { - try { - // setup the server... - String baseUrl = buildUrl(port); - String url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + coreName; - SolrClient client = getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT, 60000); - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - protected SolrClient createNewSolrClient( - String coreName, int port, int connectionTimeoutMillis, int socketTimeoutMillis) { - try { - // setup the server... - String baseUrl = buildUrl(port); - String url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + coreName; - SolrClient client = getHttpSolrClient(url, connectionTimeoutMillis, socketTimeoutMillis); - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } + String baseUrl = buildUrl(port); + String url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + coreName; + return getHttpSolrClient(url, DEFAULT_CONNECTION_TIMEOUT, 60000); } protected SolrClient createNewSolrClient(String collection, String baseUrl) { - try { - // setup the server... - SolrClient client = - getHttpSolrClient(baseUrl + "/" + collection, DEFAULT_CONNECTION_TIMEOUT, 60000); - return client; - } catch (Exception ex) { - throw new RuntimeException(ex); - } + return getHttpSolrClient(baseUrl + "/" + collection); } protected String getBaseUrl(JettySolrRunner jetty) { From dcfdc68e5691c921a032e1c623960e877b3686a0 Mon Sep 17 00:00:00 2001 From: Noble Paul Date: Wed, 7 Dec 2022 14:19:54 +1100 Subject: [PATCH 08/18] SOLR-15732: addressing test failures --- .../solr/common/cloud/SolrZkClient.java | 17 ++++++++ .../solr/common/cloud/ZkStateReader.java | 42 +++++++++---------- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java index c85719116cd..9070406d84e 100644 --- a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java +++ b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/SolrZkClient.java @@ -440,6 +440,12 @@ public byte[] getData( return result; } + public NodeData getNode(final String path, Watcher watcher, boolean retryOnConnLoss) + throws KeeperException, InterruptedException { + Stat stat = new Stat(); + return new NodeData(stat, getData(path, watcher, stat, retryOnConnLoss)); + } + /** Returns node's state */ public Stat setData( final String path, final byte data[], final int version, boolean retryOnConnLoss) @@ -1090,4 +1096,15 @@ public EntryWriter put(CharSequence k, Object v) throws IOException { }); } } + + public static class NodeData { + + public final Stat stat; + public final byte[] data; + + public NodeData(Stat stat, byte[] data) { + this.stat = stat; + this.data = data; + } + } } diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java index 9011f750876..37e6d981ff3 100644 --- a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java +++ b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/ZkStateReader.java @@ -2252,7 +2252,7 @@ public void applyModificationAndExportToZk(UnaryOperator op) { try { final Stat stat = getZkClient().setData(ALIASES, modAliasesJson, curAliases.getZNodeVersion(), true); - setIfNewer(Aliases.fromJSON(modAliasesJson, stat.getVersion())); + setIfNewer(new SolrZkClient.NodeData(stat, modAliasesJson)); return; } catch (KeeperException.BadVersionException e) { log.debug("{}", e, e); @@ -2292,16 +2292,9 @@ public boolean update() throws KeeperException, InterruptedException { if (log.isDebugEnabled()) { log.debug("Checking ZK for most up to date Aliases {}", ALIASES); } - Stat stat = zkClient.getZooKeeper().exists(ALIASES, null); - if (stat == null || stat.getVersion() <= aliases.getZNodeVersion()) { - return false; - } else { - stat = new Stat(); - } // Call sync() first to ensure the subsequent read (getData) is up to date. zkClient.getZooKeeper().sync(ALIASES, null, null); - final byte[] data = zkClient.getData(ALIASES, null, stat, true); - return setIfNewer(Aliases.fromJSON(data, stat.getVersion())); + return setIfNewer(zkClient.getNode(ALIASES, null, true)); } // ZK Watcher interface @@ -2315,11 +2308,7 @@ public void process(WatchedEvent event) { log.debug("Aliases: updating"); // re-register the watch - Stat stat = new Stat(); - final byte[] data = zkClient.getData(ALIASES, this, stat, true); - // note: it'd be nice to avoid possibly needlessly parsing if we don't update aliases but - // not a big deal - setIfNewer(Aliases.fromJSON(data, stat.getVersion())); + setIfNewer(zkClient.getNode(ALIASES, this, true)); } catch (NoNodeException e) { // /aliases.json will not always exist } catch (KeeperException.ConnectionLossException @@ -2340,22 +2329,29 @@ public void process(WatchedEvent event) { * Update the internal aliases reference with a new one, provided that its ZK version has * increased. * - * @param newAliases the potentially newer version of Aliases + * @param n the node data * @return true if aliases have been updated to a new version, false otherwise */ - private boolean setIfNewer(Aliases newAliases) { - assert newAliases.getZNodeVersion() >= 0; + private boolean setIfNewer(SolrZkClient.NodeData n) { + assert n.stat.getVersion() >= 0; synchronized (this) { - int cmp = Integer.compare(aliases.getZNodeVersion(), newAliases.getZNodeVersion()); + int cmp = Integer.compare(aliases.getZNodeVersion(), n.stat.getVersion()); if (cmp < 0) { - log.debug("Aliases: cmp={}, new definition is: {}", cmp, newAliases); - aliases = newAliases; + if (log.isDebugEnabled()) { + log.debug( + "Aliases: cmp={}, new definition is: {}", + cmp, + Aliases.fromJSON(n.data, n.stat.getVersion())); + } + aliases = Aliases.fromJSON(n.data, n.stat.getVersion()); this.notifyAll(); return true; } else { - log.debug("Aliases: cmp={}, not overwriting ZK version.", cmp); - assert cmp != 0 || Arrays.equals(aliases.toJSON(), newAliases.toJSON()) - : aliases + " != " + newAliases; + if (log.isDebugEnabled()) { + log.debug("Aliases: cmp={}, not overwriting ZK version.", cmp); + } + assert cmp != 0 || Arrays.equals(aliases.toJSON(), n.data) + : aliases + " != " + Aliases.fromJSON(n.data, n.stat.getVersion()); return false; } } From f8cc33f7b422201bc074171a2a99458e4ca04954 Mon Sep 17 00:00:00 2001 From: Noble Paul Date: Wed, 7 Dec 2022 14:59:37 +1100 Subject: [PATCH 09/18] SOLR-16575: splitshard should honour createNodeSet (#1212) --- solr/CHANGES.txt | 2 + .../cloud/api/collections/SplitShardCmd.java | 8 ++- .../handler/admin/CollectionsHandler.java | 4 +- .../org/apache/solr/cloud/SplitShardTest.java | 62 +++++++++++++++++++ .../solrj/request/CollectionAdminRequest.java | 9 +++ 5 files changed, 83 insertions(+), 2 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index d34eac70135..b84be39d6e8 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -158,6 +158,8 @@ Other Changes * SOLR-15861: ConcurrentUpdateSolrClient should work with ManagedExecutorService (Sammy Chu, Kevin Risden) +SOLR-16575: splitshard should honour createNodeSet (noble) + ================== 9.1.0 ================== New Features diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/SplitShardCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/SplitShardCmd.java index 0212db16ed2..23473694b59 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/SplitShardCmd.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/SplitShardCmd.java @@ -18,6 +18,7 @@ package org.apache.solr.cloud.api.collections; import static org.apache.solr.client.solrj.impl.SolrClientNodeStateProvider.Variable.CORE_IDX; +import static org.apache.solr.cloud.api.collections.CollectionHandlingUtils.RANDOM; import static org.apache.solr.common.cloud.ZkStateReader.COLLECTION_PROP; import static org.apache.solr.common.cloud.ZkStateReader.REPLICA_TYPE; import static org.apache.solr.common.cloud.ZkStateReader.SHARD_ID_PROP; @@ -577,7 +578,12 @@ public boolean split(ClusterState clusterState, ZkNodeProps message, NamedList(clusterState.getLiveNodes())) + .onNodes( + Assign.getLiveOrLiveAndCreateNodeSetList( + clusterState.getLiveNodes(), + message, + RANDOM, + ccc.getSolrCloudManager().getDistribStateManager())) .build(); Assign.AssignStrategy assignStrategy = Assign.createAssignStrategy(ccc.getCoreContainer()); List replicaPositions = diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java index 84f397b0e52..a3c00dd29de 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java @@ -47,6 +47,7 @@ import static org.apache.solr.common.params.CollectionAdminParams.COLLECTION; import static org.apache.solr.common.params.CollectionAdminParams.COLL_CONF; import static org.apache.solr.common.params.CollectionAdminParams.COUNT_PROP; +import static org.apache.solr.common.params.CollectionAdminParams.CREATE_NODE_SET_PARAM; import static org.apache.solr.common.params.CollectionAdminParams.FOLLOW_ALIASES; import static org.apache.solr.common.params.CollectionAdminParams.PER_REPLICA_STATE; import static org.apache.solr.common.params.CollectionAdminParams.PROPERTY_NAME; @@ -933,7 +934,8 @@ public enum CollectionOperation implements CollectionOp { NUM_SUB_SHARDS, SPLIT_FUZZ, SPLIT_BY_PREFIX, - FOLLOW_ALIASES); + FOLLOW_ALIASES, + CREATE_NODE_SET_PARAM); return copyPropertiesWithPrefix(req.getParams(), map, PROPERTY_PREFIX); }), DELETESHARD_OP( diff --git a/solr/core/src/test/org/apache/solr/cloud/SplitShardTest.java b/solr/core/src/test/org/apache/solr/cloud/SplitShardTest.java index 1d8cd1bd092..dd20903deed 100644 --- a/solr/core/src/test/org/apache/solr/cloud/SplitShardTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/SplitShardTest.java @@ -23,8 +23,11 @@ import java.lang.invoke.MethodHandles; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.apache.solr.client.solrj.SolrClient; @@ -41,6 +44,8 @@ import org.apache.solr.common.cloud.DocCollection; import org.apache.solr.common.cloud.Replica; import org.apache.solr.common.cloud.Slice; +import org.apache.solr.common.util.NamedList; +import org.apache.solr.embedded.JettySolrRunner; import org.hamcrest.MatcherAssert; import org.junit.After; import org.junit.Before; @@ -310,6 +315,63 @@ void doLiveSplitShard(String collectionName, int repFactor, int nThreads) throws log.info("Number of documents indexed and queried : {}", numDocs); } + public void testShardSplitWithNodeset() throws Exception { + String COLL = "shard_split_nodeset"; + + CollectionAdminRequest.createCollection(COLL, "conf", 2, 2).process(cluster.getSolrClient()); + cluster.waitForActiveCollection(COLL, 2, 4); + + JettySolrRunner jetty = cluster.startJettySolrRunner(); + + CollectionAdminRequest.SplitShard splitShard = + CollectionAdminRequest.splitShard(COLL) + .setCreateNodeSet(jetty.getNodeName()) + .setShardName("shard1"); + NamedList response = splitShard.process(cluster.getSolrClient()).getResponse(); + assertNotNull(response.get("success")); + + cluster + .getZkStateReader() + .waitForState( + COLL, + 10, + TimeUnit.SECONDS, + (liveNodes, collectionState) -> + testColl(jetty, collectionState, List.of("shard1_0", "shard1_1"))); + + JettySolrRunner randomJetty = cluster.getRandomJetty(random()); + splitShard = + CollectionAdminRequest.splitShard(COLL) + .setCreateNodeSet(randomJetty.getNodeName()) + .setShardName("shard2"); + response = splitShard.process(cluster.getSolrClient()).getResponse(); + assertNotNull(response.get("success")); + + cluster + .getZkStateReader() + .waitForState( + COLL, + 10, + TimeUnit.SECONDS, + (liveNodes, collectionState) -> + testColl(randomJetty, collectionState, List.of("shard2_0", "shard2_1"))); + } + + private boolean testColl( + JettySolrRunner jetty, DocCollection collectionState, Collection sh) { + Collection set = new HashSet<>(sh); + collectionState.forEachReplica( + (s, replica) -> { + if (replica.getNodeName().equals(jetty.getNodeName()) + && !replica.isLeader() + && set.contains(replica.shard)) { + set.remove(replica.shard); + } + }); + + return set.isEmpty(); + } + @Test public void testLiveSplit() throws Exception { // Debugging tips: if this fails, it may be easier to debug by lowering the number fo threads to diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java index 3cc4700cfa8..0a41b2c782a 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java @@ -1569,6 +1569,7 @@ public static class SplitShard extends AsyncCollectionAdminRequest { protected Float splitFuzz; private Properties properties; + protected String createNodeSet; private SplitShard(String collection) { super(CollectionAction.SPLITSHARD); @@ -1580,6 +1581,11 @@ public SplitShard setRanges(String ranges) { return this; } + public SplitShard setCreateNodeSet(String nodeset) { + this.createNodeSet = nodeset; + return this; + } + public String getRanges() { return ranges; } @@ -1671,6 +1677,9 @@ public SolrParams getParams() { if (properties != null) { addProperties(params, properties); } + if (createNodeSet != null) { + params.set(CREATE_NODE_SET_PARAM, createNodeSet); + } return params; } } From 8675e48e05ac6468bdc63d007ecfce65a5d38e14 Mon Sep 17 00:00:00 2001 From: Kevin Risden Date: Wed, 7 Dec 2022 13:26:38 -0500 Subject: [PATCH 10/18] SOLR-8975: Ensure poll time default of 250 is set on builder (#1222) --- .../solr/client/solrj/impl/ConcurrentUpdateSolrClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java index a3edf13cb3d..5150318b339 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.java @@ -858,7 +858,7 @@ public static class Builder extends SolrClientBuilder { protected String baseSolrUrl; protected int queueSize = 10; protected int threadCount; - protected int pollQueueTime; + protected int pollQueueTime = 250; protected ExecutorService executorService; protected boolean streamDeletes; From 0bbff1b2c0f62545d8d5ac2a9632815fbee12496 Mon Sep 17 00:00:00 2001 From: Kevin Risden Date: Wed, 7 Dec 2022 14:01:37 -0500 Subject: [PATCH 11/18] disable-useless-errorprone-checks (#1201) --- gradle/validation/error-prone.gradle | 180 ++++++++++++++------------- 1 file changed, 91 insertions(+), 89 deletions(-) diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle index 6dba70b5009..72d0e3cfc87 100644 --- a/gradle/validation/error-prone.gradle +++ b/gradle/validation/error-prone.gradle @@ -67,11 +67,13 @@ allprojects { prj -> // List of enabled/disabled checks // Please keep this synced with https://errorprone.info/bugpatterns when upgrading! + // Do *NOT* enable checks based on their name or description. Read the source code and make sure they are useful! + // Most error-prone checks are not useful for non-google software. // On by Default : ERROR '-Xep:AlwaysThrows:ERROR', - '-Xep:AndroidInjectionBeforeSuper:ERROR', + // '-Xep:AndroidInjectionBeforeSuper:OFF', // we don't use android '-Xep:ArrayEquals:ERROR', '-Xep:ArrayFillIncompatibleType:ERROR', '-Xep:ArrayHashCode:ERROR', @@ -79,31 +81,31 @@ allprojects { prj -> '-Xep:ArraysAsListPrimitiveArray:ERROR', '-Xep:AsyncCallableReturnsNull:ERROR', '-Xep:AsyncFunctionReturnsNull:ERROR', - '-Xep:AutoValueBuilderDefaultsInConstructor:ERROR', - '-Xep:AutoValueConstructorOrderChecker:ERROR', + // '-Xep:AutoValueBuilderDefaultsInConstructor:OFF', // we don't use autovalue + // '-Xep:AutoValueConstructorOrderChecker:OFF', // we don't use autovalue '-Xep:BadAnnotationImplementation:ERROR', '-Xep:BadShiftAmount:ERROR', - '-Xep:BanJNDI:ERROR', + '-Xep:BanJNDI:ERROR', // todo - implement with forbidden APIs instead? '-Xep:BoxedPrimitiveEquality:ERROR', - '-Xep:BundleDeserializationCast:ERROR', + // '-Xep:BundleDeserializationCast:OFF', // we don't use android '-Xep:ChainingConstructorIgnoresParameter:ERROR', '-Xep:CheckNotNullMultipleTimes:ERROR', - '-Xep:CheckReturnValue:ERROR', + // '-Xep:CheckReturnValue:OFF', // we don't use these annotations '-Xep:CollectionToArraySafeParameter:ERROR', // '-Xep:ComparableType:OFF', // SolrTestCaseJ4.Doc and Fld are messy '-Xep:ComparingThisWithNull:ERROR', '-Xep:ComparisonOutOfRange:ERROR', - '-Xep:CompatibleWithAnnotationMisuse:ERROR', - '-Xep:CompileTimeConstant:ERROR', + // '-Xep:CompatibleWithAnnotationMisuse:OFF', // we don't use this annotation + // '-Xep:CompileTimeConstant:OFF', // we don't use this annotation '-Xep:ComputeIfAbsentAmbiguousReference:ERROR', '-Xep:ConditionalExpressionNumericPromotion:ERROR', '-Xep:ConstantOverflow:ERROR', - '-Xep:DaggerProvidesNull:ERROR', + // '-Xep:DaggerProvidesNull:OFF', // we don't use dagger '-Xep:DangerousLiteralNull:ERROR', '-Xep:DeadException:ERROR', '-Xep:DeadThread:ERROR', '-Xep:DiscardedPostfixExpression:ERROR', - '-Xep:DoNotCall:ERROR', + // '-Xep:DoNotCall:OFF', // we don't use this annotation '-Xep:DoNotMock:ERROR', '-Xep:DoubleBraceInitialization:ERROR', '-Xep:DuplicateMapKeys:ERROR', @@ -117,36 +119,36 @@ allprojects { prj -> '-Xep:EqualsNull:ERROR', '-Xep:EqualsReference:ERROR', '-Xep:EqualsWrongThing:ERROR', - '-Xep:FloggerFormatString:ERROR', - '-Xep:FloggerLogVarargs:ERROR', - '-Xep:FloggerSplitLogStatement:ERROR', - '-Xep:ForOverride:ERROR', + // '-Xep:FloggerFormatString:OFF', // we don't use flogger + // '-Xep:FloggerLogVarargs:OFF', // we don't use flogger + // '-Xep:FloggerSplitLogStatement:OFF', // we don't use flogger + // '-Xep:ForOverride:OFF', // we don't use this annotation '-Xep:FormatString:ERROR', - '-Xep:FormatStringAnnotation:ERROR', + // '-Xep:FormatStringAnnotation:OFF', // we don't use this annotation '-Xep:FromTemporalAccessor:ERROR', '-Xep:FunctionalInterfaceMethodChanged:ERROR', '-Xep:FuturesGetCheckedIllegalExceptionType:ERROR', '-Xep:FuzzyEqualsShouldNotBeUsedInEqualsMethod:ERROR', '-Xep:GetClassOnAnnotation:ERROR', '-Xep:GetClassOnClass:ERROR', - '-Xep:GuardedBy:ERROR', - '-Xep:GuiceAssistedInjectScoping:ERROR', - '-Xep:GuiceAssistedParameters:ERROR', - '-Xep:GuiceInjectOnFinalField:ERROR', + // '-Xep:GuardedBy:OFF', // we don't use this annotation + // '-Xep:GuiceAssistedInjectScoping:OFF', // we don't use guice + // '-Xep:GuiceAssistedParameters:OFF', // we don't use guice + // '-Xep:GuiceInjectOnFinalField:OFF', // we don't use guice '-Xep:HashtableContains:ERROR', '-Xep:IdentityBinaryExpression:ERROR', '-Xep:IdentityHashMapBoxing:ERROR', - '-Xep:IgnoredPureGetter:ERROR', - '-Xep:Immutable:ERROR', + // '-Xep:IgnoredPureGetter:OFF', // we don't use these annotations + // '-Xep:Immutable:OFF', // we don't use this annotation '-Xep:Incomparable:ERROR', - '-Xep:IncompatibleArgumentType:ERROR', - '-Xep:IncompatibleModifiers:ERROR', + // '-Xep:IncompatibleArgumentType:OFF', // we don't use this annotation + // '-Xep:IncompatibleModifiers:OFF', // we don't use this annotation '-Xep:IndexOfChar:ERROR', '-Xep:InexactVarargsConditional:ERROR', '-Xep:InfiniteRecursion:ERROR', - '-Xep:InjectMoreThanOneScopeAnnotationOnClass:ERROR', - '-Xep:InjectOnMemberAndConstructor:ERROR', - '-Xep:InlineMeValidator:ERROR', + '-Xep:InjectMoreThanOneScopeAnnotationOnClass:ERROR', // todo - check if we use this annotation? + '-Xep:InjectOnMemberAndConstructor:ERROR', // todo - check if we use this annotation? + // '-Xep:InlineMeValidator:OFF', // we don't use this annotation '-Xep:InstantTemporalUnit:ERROR', '-Xep:InvalidJavaTimeConstant:ERROR', '-Xep:InvalidPatternSyntax:ERROR', @@ -154,11 +156,11 @@ allprojects { prj -> '-Xep:InvalidZoneId:ERROR', '-Xep:IsInstanceIncompatibleType:ERROR', '-Xep:IsInstanceOfClass:ERROR', - '-Xep:IsLoggableTagLength:ERROR', - '-Xep:JUnit3TestNotRun:ERROR', + // '-Xep:IsLoggableTagLength:OFF', // we don't use android + // '-Xep:JUnit3TestNotRun:OFF', // we don't use junit3 '-Xep:JUnit4ClassAnnotationNonStatic:ERROR', - '-Xep:JUnit4SetUpNotRun:ERROR', - '-Xep:JUnit4TearDownNotRun:ERROR', + // '-Xep:JUnit4SetUpNotRun:OFF', // LuceneTestCase takes care + // '-Xep:JUnit4TearDownNotRun:OFF', // LuceneTestCase takes care // '-Xep:JUnit4TestNotRun:OFF', // RandomizedRunner finds unannotated test methods no problem '-Xep:JUnit4TestsNotRunWithinEnclosed:ERROR', '-Xep:JUnitAssertSameCheck:ERROR', @@ -171,33 +173,33 @@ allprojects { prj -> '-Xep:LoopConditionChecker:ERROR', '-Xep:LossyPrimitiveCompare:ERROR', '-Xep:MathRoundIntLong:ERROR', - '-Xep:MislabeledAndroidString:ERROR', - '-Xep:MisplacedScopeAnnotations:ERROR', - '-Xep:MissingSuperCall:ERROR', - '-Xep:MissingTestCall:ERROR', + // '-Xep:MislabeledAndroidString:OFF', // we don't use android + '-Xep:MisplacedScopeAnnotations:ERROR', // todo - check if we use this annotation? + // '-Xep:MissingSuperCall:OFF', // we don't use this annotation + // '-Xep:MissingTestCall:OFF', // we don't use this annotation '-Xep:MisusedDayOfYear:ERROR', '-Xep:MisusedWeekYear:ERROR', '-Xep:MixedDescriptors:ERROR', '-Xep:MockitoUsage:ERROR', '-Xep:ModifyingCollectionWithItself:ERROR', - '-Xep:MoreThanOneInjectableConstructor:ERROR', - '-Xep:MustBeClosedChecker:ERROR', + '-Xep:MoreThanOneInjectableConstructor:ERROR', // todo - check if we use this annotation? + // '-Xep:MustBeClosedChecker:OFF', // we don't use this annotation '-Xep:NCopiesOfChar:ERROR', '-Xep:NoCanIgnoreReturnValueOnClasses:ERROR', '-Xep:NonCanonicalStaticImport:ERROR', - '-Xep:NonFinalCompileTimeConstant:ERROR', + // '-Xep:NonFinalCompileTimeConstant:OFF', // we don't use this annotation '-Xep:NonRuntimeAnnotation:ERROR', - '-Xep:NullArgumentForNonNullParameter:ERROR', + // '-Xep:NullArgumentForNonNullParameter:OFF', // we don't use this annotation '-Xep:NullTernary:ERROR', - '-Xep:NullableOnContainingClass:ERROR', + // '-Xep:NullableOnContainingClass:OFF', // we don't use this annotation '-Xep:OptionalEquality:ERROR', '-Xep:OptionalMapUnusedValue:ERROR', '-Xep:OptionalOfRedundantMethod:ERROR', - '-Xep:OverlappingQualifierAndScopeAnnotation:ERROR', + '-Xep:OverlappingQualifierAndScopeAnnotation:ERROR', // todo - check if we use this annotation? '-Xep:OverridesJavaxInjectableMethod:ERROR', '-Xep:PackageInfo:ERROR', '-Xep:ParametersButNotParameterized:ERROR', - '-Xep:ParcelableCreator:ERROR', + // '-Xep:ParcelableCreator:OFF', // we don't use android '-Xep:PeriodFrom:ERROR', '-Xep:PeriodGetTemporalUnit:ERROR', '-Xep:PeriodTimeMath:ERROR', @@ -208,29 +210,29 @@ allprojects { prj -> '-Xep:ProtoStringFieldReferenceEquality:ERROR', '-Xep:ProtoTruthMixedDescriptors:ERROR', '-Xep:ProtocolBufferOrdinal:ERROR', - '-Xep:ProvidesMethodOutsideOfModule:ERROR', + // '-Xep:ProvidesMethodOutsideOfModule:OFF', // we don't use guice '-Xep:RandomCast:ERROR', '-Xep:RandomModInteger:ERROR', - '-Xep:RectIntersectReturnValueIgnored:ERROR', - '-Xep:RequiredModifiers:ERROR', - '-Xep:RestrictedApiChecker:ERROR', + // '-Xep:RectIntersectReturnValueIgnored:OFF', // we don't use android + // '-Xep:RequiredModifiers:OFF', // we don't use this annotation + // '-Xep:RestrictedApiChecker:OFF', // we don't use this annotation // '-Xep:ReturnValueIgnored:OFF', // todo check if useful or comment why not '-Xep:SelfAssignment:ERROR', '-Xep:SelfComparison:ERROR', '-Xep:SelfEquals:ERROR', - '-Xep:ShouldHaveEvenArgs:ERROR', + // '-Xep:ShouldHaveEvenArgs:OFF', // we don't use truth '-Xep:SizeGreaterThanOrEqualsZero:ERROR', '-Xep:StreamToString:ERROR', '-Xep:StringBuilderInitWithChar:ERROR', '-Xep:SubstringOfZero:ERROR', '-Xep:SuppressWarningsDeprecated:ERROR', '-Xep:TemporalAccessorGetChronoField:ERROR', - '-Xep:TestParametersNotInitialized:ERROR', - '-Xep:TheoryButNoTheories:ERROR', - '-Xep:ThrowIfUncheckedKnownChecked:ERROR', + // '-Xep:TestParametersNotInitialized:OFF', // we don't use this annotation + // '-Xep:TheoryButNoTheories:OFF', // we don't use junit theory apis/runner + // '-Xep:ThrowIfUncheckedKnownChecked:OFF', // we don't use this annotation '-Xep:ThrowNull:ERROR', '-Xep:TreeToString:ERROR', - '-Xep:TruthSelfEquals:ERROR', + // '-Xep:TruthSelfEquals:OFF', // we don't use truth '-Xep:TryFailThrowable:ERROR', '-Xep:TypeParameterQualifier:ERROR', '-Xep:UnicodeDirectionalityCharacters:ERROR', @@ -250,16 +252,16 @@ allprojects { prj -> '-Xep:AlmostJavadoc:WARN', // '-Xep:AlreadyChecked:OFF', // todo check if useful or comment why not // '-Xep:AmbiguousMethodReference:OFF', // todo check if useful or comment why not - '-Xep:AnnotateFormatMethod:WARN', + // '-Xep:AnnotateFormatMethod:OFF', // we don't use this annotation // '-Xep:ArgumentSelectionDefectChecker:OFF', // todo check if useful or comment why not '-Xep:ArrayAsKeyOfSetOrMap:WARN', '-Xep:AssertEqualsArgumentOrderChecker:WARN', '-Xep:AssertThrowsMultipleStatements:WARN', '-Xep:AssertionFailureIgnored:WARN', - '-Xep:AssistedInjectAndInjectOnSameConstructor:WARN', - '-Xep:AutoValueFinalMethods:WARN', - '-Xep:AutoValueImmutableFields:WARN', - '-Xep:AutoValueSubclassLeaked:WARN', + '-Xep:AssistedInjectAndInjectOnSameConstructor:WARN', // todo - check if we use this annotation? + // '-Xep:AutoValueFinalMethods:OFF', // we don't use autovalue + // '-Xep:AutoValueImmutableFields:OFF', // we don't use autovalue + // '-Xep:AutoValueSubclassLeaked:OFF', // we don't use autovalue '-Xep:BadComparable:WARN', // '-Xep:BadImport:OFF', // style preference that we don't want to enforce '-Xep:BadInstanceof:WARN', @@ -267,7 +269,7 @@ allprojects { prj -> '-Xep:BigDecimalEquals:WARN', '-Xep:BigDecimalLiteralDouble:WARN', '-Xep:BoxedPrimitiveConstructor:WARN', - '-Xep:BugPatternNaming:WARN', + // '-Xep:BugPatternNaming:OFF', // we don't use this annotation '-Xep:ByteBufferBackingArray:WARN', '-Xep:CacheLoaderNull:WARN', '-Xep:CanonicalDuration:WARN', @@ -278,7 +280,7 @@ allprojects { prj -> '-Xep:CharacterGetNumericValue:WARN', '-Xep:ClassCanBeStatic:WARN', '-Xep:ClassNewInstance:WARN', - '-Xep:CloseableProvides:WARN', + // '-Xep:CloseableProvides:OFF', // we don't use this annotation '-Xep:CollectionUndefinedEquality:WARN', '-Xep:CollectorShouldNotUseState:WARN', '-Xep:ComparableAndComparator:WARN', @@ -286,18 +288,18 @@ allprojects { prj -> // '-Xep:ComplexBooleanConstant:OFF', // non trivial to fix in some cases '-Xep:DateChecker:WARN', '-Xep:DateFormatConstant:WARN', - '-Xep:DefaultCharset:WARN', + // '-Xep:DefaultCharset:OFF', // we have forbiddenapis for that '-Xep:DefaultPackage:WARN', '-Xep:DeprecatedVariable:WARN', '-Xep:DirectInvocationOnMock:WARN', '-Xep:DistinctVarargsChecker:WARN', - '-Xep:DoNotCallSuggester:WARN', - '-Xep:DoNotClaimAnnotations:WARN', - '-Xep:DoNotMockAutoValue:WARN', + // '-Xep:DoNotCallSuggester:OFF', // we don't use this annotation + // '-Xep:DoNotClaimAnnotations:OFF', // we don't use this annotation + // '-Xep:DoNotMockAutoValue:OFF', // we don't use autovalue // '-Xep:DoubleCheckedLocking:OFF', // todo check if useful or comment why not '-Xep:EmptyBlockTag:WARN', // '-Xep:EmptyCatch:OFF', // todo check if useful or comment why not - might be handled by ECJ? - '-Xep:EmptySetMultibindingContributions:WARN', + // '-Xep:EmptySetMultibindingContributions:OFF', // we don't use this annotation '-Xep:EqualsGetClass:WARN', '-Xep:EqualsIncompatibleType:WARN', '-Xep:EqualsUnsafeCast:WARN', @@ -312,29 +314,29 @@ allprojects { prj -> '-Xep:FloatCast:WARN', '-Xep:FloatingPointAssertionWithinEpsilon:WARN', '-Xep:FloatingPointLiteralPrecision:WARN', - '-Xep:FloggerArgumentToString:WARN', - '-Xep:FloggerStringConcatenation:WARN', - '-Xep:FragmentInjection:WARN', - '-Xep:FragmentNotInstantiable:WARN', + // '-Xep:FloggerArgumentToString:OFF', // we don't use flogger + // '-Xep:FloggerStringConcatenation:OFF', // we don't use flogger + // '-Xep:FragmentInjection:OFF', // we don't use android + // '-Xep:FragmentNotInstantiable:OFF', // we don't use android // '-Xep:FutureReturnValueIgnored:OFF', // todo check if useful or comment why not '-Xep:GetClassOnEnum:WARN', '-Xep:HidingField:WARN', '-Xep:IdentityHashMapUsage:WARN', - '-Xep:ImmutableAnnotationChecker:WARN', + // '-Xep:ImmutableAnnotationChecker:OFF', // we don't use this annotation '-Xep:ImmutableEnumChecker:WARN', '-Xep:InconsistentCapitalization:WARN', '-Xep:InconsistentHashCode:WARN', '-Xep:IncorrectMainMethod:WARN', '-Xep:IncrementInForLoopAndHeader:WARN', '-Xep:InheritDoc:WARN', - '-Xep:InjectInvalidTargetingOnScopingAnnotation:WARN', + // '-Xep:InjectInvalidTargetingOnScopingAnnotation:OFF', // we don't use this annotation '-Xep:InjectOnConstructorOfAbstractClass:WARN', '-Xep:InjectScopeAnnotationOnInterfaceOrAbstractClass:WARN', '-Xep:InjectedConstructorAnnotations:WARN', // '-Xep:InlineFormatString:OFF', // this introduces redundancy in format strings - '-Xep:InlineMeInliner:WARN', + // '-Xep:InlineMeInliner:OFF', // we don't use this annotation // '-Xep:InlineMeSuggester:OFF', // We don't use this annotation - // '-Xep:InputStreamSlowMultibyteRead:OFF' // todo check if useful or comment why not, + // '-Xep:InputStreamSlowMultibyteRead:OFF', // todo check if useful or comment why not '-Xep:InstanceOfAndCastMatchWrongType:WARN', '-Xep:IntLongMath:WARN', // '-Xep:InvalidBlockTag:OFF', // this is needed for tags like lucene.internal @@ -344,9 +346,9 @@ allprojects { prj -> '-Xep:InvalidThrows:WARN', '-Xep:InvalidThrowsLink:WARN', '-Xep:IterableAndIterator:WARN', - '-Xep:JUnit3FloatingPointComparisonWithoutDelta:WARN', - '-Xep:JUnit4ClassUsedInJUnit3:WARN', - '-Xep:JUnitAmbiguousTestClass:WARN', + // '-Xep:JUnit3FloatingPointComparisonWithoutDelta:OFF', // we don't use junit3 + // '-Xep:JUnit4ClassUsedInJUnit3:OFF', // we don't use junit3 + // '-Xep:JUnitAmbiguousTestClass:OFF', // we don't use junit3 '-Xep:JavaDurationGetSecondsGetNano:WARN', '-Xep:JavaDurationWithNanos:WARN', '-Xep:JavaDurationWithSeconds:WARN', @@ -355,7 +357,7 @@ allprojects { prj -> '-Xep:JavaLocalDateTimeGetNano:WARN', '-Xep:JavaLocalTimeGetNano:WARN', '-Xep:JavaPeriodGetDays:WARN', - '-Xep:JavaTimeDefaultTimeZone:WARN', + // '-Xep:JavaTimeDefaultTimeZone:OFF', // forbidden-apis checks this // '-Xep:JavaUtilDate:OFF', // todo check if useful or comment why not '-Xep:JavaxInjectOnFinalField:WARN', '-Xep:JdkObsolete:WARN', @@ -376,7 +378,7 @@ allprojects { prj -> '-Xep:LoopOverCharArray:WARN', '-Xep:MalformedInlineTag:WARN', '-Xep:MathAbsoluteRandom:WARN', - '-Xep:MemoizeConstantVisitorStateLookups:WARN', + // '-Xep:MemoizeConstantVisitorStateLookups:OFF', // we don't use this class '-Xep:MissingCasesInEnumSwitch:WARN', '-Xep:MissingFail:WARN', '-Xep:MissingImplementsComparable:WARN', @@ -398,10 +400,10 @@ allprojects { prj -> // '-Xep:NonCanonicalType:OFF', // todo check if useful or comment why not '-Xep:NonOverridingEquals:WARN', '-Xep:NullOptional:WARN', - '-Xep:NullableConstructor:WARN', - '-Xep:NullablePrimitive:WARN', - '-Xep:NullablePrimitiveArray:WARN', - '-Xep:NullableVoid:WARN', + // '-Xep:NullableConstructor:OFF', // we don't use this annotation + // '-Xep:NullablePrimitive:OFF', // we don't use this annotation + // '-Xep:NullablePrimitiveArray:OFF', // we don't use this annotation + // '-Xep:NullableVoid:OFF', // we don't use this annotation '-Xep:ObjectEqualsForPrimitives:WARN', // '-Xep:ObjectToString:OFF', // todo check if useful or comment why not '-Xep:ObjectsHashCodePrimitive:WARN', @@ -409,7 +411,7 @@ allprojects { prj -> '-Xep:OptionalMapToOptional:WARN', '-Xep:OptionalNotPresent:WARN', '-Xep:OrphanedFormatString:WARN', - '-Xep:OutlineNone:WARN', + // '-Xep:OutlineNone:OFF', // we don't use gwt '-Xep:OverrideThrowableToString:WARN', '-Xep:Overrides:WARN', '-Xep:OverridesGuiceInjectableMethod:WARN', @@ -437,7 +439,7 @@ allprojects { prj -> // '-Xep:StreamResourceLeak:OFF', // todo check if useful or comment why not '-Xep:StreamToIterable:WARN', // '-Xep:StringSplitter:OFF', // todo check if useful or comment why not - might be able to use forbidden-apis for this? - '-Xep:SwigMemoryLeak:WARN', + // '-Xep:SwigMemoryLeak:OFF', // we don't use swig // '-Xep:SynchronizeOnNonFinalField:OFF', // todo check if useful or comment why not // '-Xep:ThreadJoinLoop:OFF', // todo check if useful or comment why not // '-Xep:ThreadLocalUsage:OFF', // todo check if useful or comment why not @@ -445,10 +447,10 @@ allprojects { prj -> '-Xep:ThreeLetterTimeZoneID:WARN', '-Xep:TimeUnitConversionChecker:WARN', '-Xep:ToStringReturnsNull:WARN', - '-Xep:TruthAssertExpected:WARN', - '-Xep:TruthConstantAsserts:WARN', - '-Xep:TruthGetOrDefault:WARN', - '-Xep:TruthIncompatibleType:WARN', + // '-Xep:TruthAssertExpected:OFF', // we don't use truth + // '-Xep:TruthConstantAsserts:OFF', // we don't use truth + // '-Xep:TruthGetOrDefault:OFF', // we don't use truth + // '-Xep:TruthIncompatibleType:OFF', // we don't use truth '-Xep:TypeEquals:WARN', '-Xep:TypeNameShadowing:WARN', // '-Xep:TypeParameterShadowing:OFF', // todo check if useful or comment why not @@ -457,7 +459,7 @@ allprojects { prj -> '-Xep:UndefinedEquals:WARN', '-Xep:UnescapedEntity:WARN', // '-Xep:UnicodeEscape:OFF', // can't enable since Lucene/Solr tests use unicode a bunch - '-Xep:UnnecessaryAssignment:WARN', + // '-Xep:UnnecessaryAssignment:OFF', // we don't use these annotations '-Xep:UnnecessaryLambda:WARN', '-Xep:UnnecessaryLongToIntConversion:WARN', '-Xep:UnnecessaryMethodInvocationMatcher:WARN', @@ -471,12 +473,12 @@ allprojects { prj -> '-Xep:UnusedNestedClass:WARN', '-Xep:UnusedTypeParameter:WARN', // '-Xep:UnusedVariable:OFF', // todo check if useful or comment why not - might be able to use ecj? - '-Xep:UseBinds:WARN', + // '-Xep:UseBinds:OFF', // we don't use this annotation // '-Xep:UseCorrectAssertInTests:OFF', // we inherit from LuceneTestCase which extends Assert '-Xep:VariableNameSameAsType:WARN', // '-Xep:WaitNotInLoop:OFF', // todo check if useful or comment why not - '-Xep:WakelockReleasedDangerously:WARN', - '-Xep:WithSignatureDiscouraged:WARN', + // '-Xep:WakelockReleasedDangerously:OFF', // we don't use android + // '-Xep:WithSignatureDiscouraged:OFF', // we aren't using this error-prone internal api ] } } From 84b726030713f4140ae8cb7eec258177b0c9ef0a Mon Sep 17 00:00:00 2001 From: kiratraynor <33499975+kiratraynor@users.noreply.github.com> Date: Wed, 7 Dec 2022 11:11:25 -0800 Subject: [PATCH 12/18] SOLR-16568: Update FasterXML Woodstox to 6.4.0 (#1209) --- solr/CHANGES.txt | 4 +++- solr/licenses/woodstox-core-6.3.1.jar.sha1 | 1 - solr/licenses/woodstox-core-6.4.0.jar.sha1 | 1 + versions.lock | 2 +- versions.props | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 solr/licenses/woodstox-core-6.3.1.jar.sha1 create mode 100644 solr/licenses/woodstox-core-6.4.0.jar.sha1 diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index b84be39d6e8..8575b0e0034 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -158,7 +158,9 @@ Other Changes * SOLR-15861: ConcurrentUpdateSolrClient should work with ManagedExecutorService (Sammy Chu, Kevin Risden) -SOLR-16575: splitshard should honour createNodeSet (noble) +* SOLR-16575: splitshard should honour createNodeSet (noble) + +* SOLR-16568: Upgrade woodstox-core to 6.4.0 (Kira Traynor) ================== 9.1.0 ================== diff --git a/solr/licenses/woodstox-core-6.3.1.jar.sha1 b/solr/licenses/woodstox-core-6.3.1.jar.sha1 deleted file mode 100644 index ff23ca0a9e0..00000000000 --- a/solr/licenses/woodstox-core-6.3.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -bf29b07ca4dd81ef3c0bc18c8bd5617510a81c5d diff --git a/solr/licenses/woodstox-core-6.4.0.jar.sha1 b/solr/licenses/woodstox-core-6.4.0.jar.sha1 new file mode 100644 index 00000000000..f1a5d351ed0 --- /dev/null +++ b/solr/licenses/woodstox-core-6.4.0.jar.sha1 @@ -0,0 +1 @@ +c47579857bbf12c85499f431d4ecf27d77976b7c diff --git a/versions.lock b/versions.lock index 2abf7a6207b..3648ec1eb19 100644 --- a/versions.lock +++ b/versions.lock @@ -12,7 +12,7 @@ com.fasterxml.jackson.core:jackson-core:2.13.4 (13 constraints: 3c026a27) com.fasterxml.jackson.core:jackson-databind:2.13.4.2 (18 constraints: 3a6455da) com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.13.4 (1 constraints: ba0ea766) com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.13.4 (2 constraints: a624c1e0) -com.fasterxml.woodstox:woodstox-core:6.3.1 (3 constraints: b5283aba) +com.fasterxml.woodstox:woodstox-core:6.4.0 (3 constraints: af28dab7) com.github.ben-manes.caffeine:caffeine:3.1.1 (1 constraints: 0705fe35) com.github.jai-imageio:jai-imageio-core:1.4.0 (1 constraints: 5c0ced01) com.github.junrar:junrar:7.5.2 (1 constraints: 650c1002) diff --git a/versions.props b/versions.props index 612bdec8463..95a10dc8226 100644 --- a/versions.props +++ b/versions.props @@ -4,7 +4,7 @@ com.carrotsearch.randomizedtesting:*=2.8.1 com.carrotsearch:hppc=0.9.1 com.cybozu.labs:langdetect=1.1-20120112 com.fasterxml.jackson:jackson-bom=2.13.4.20221013 -com.fasterxml.woodstox:woodstox-core=6.2.8 +com.fasterxml.woodstox:woodstox-core=6.4.0 com.github.ben-manes.caffeine:caffeine=3.1.1 com.github.spotbugs:*=4.7.2 com.google.cloud:google-cloud-bom=0.178.0 From c04ea0bf6160614a5498833acbb7d834c616b8dc Mon Sep 17 00:00:00 2001 From: Kevin Risden Date: Wed, 7 Dec 2022 14:28:50 -0500 Subject: [PATCH 13/18] SOLR-16579: Upgrade Jackson to 2.14.1 --- solr/CHANGES.txt | 2 ++ .../jackson-annotations-2.13.4.jar.sha1 | 1 - .../jackson-annotations-2.14.1.jar.sha1 | 1 + solr/licenses/jackson-core-2.13.4.jar.sha1 | 1 - solr/licenses/jackson-core-2.14.1.jar.sha1 | 1 + .../jackson-databind-2.13.4.2.jar.sha1 | 1 - .../licenses/jackson-databind-2.14.1.jar.sha1 | 1 + .../jackson-dataformat-cbor-2.13.4.jar.sha1 | 1 - .../jackson-dataformat-cbor-2.14.1.jar.sha1 | 1 + .../jackson-dataformat-smile-2.13.4.jar.sha1 | 1 - .../jackson-dataformat-smile-2.14.1.jar.sha1 | 1 + .../jackson-dataformat-xml-2.13.4.jar.sha1 | 1 - .../jackson-dataformat-xml-2.14.1.jar.sha1 | 1 + .../jackson-datatype-jdk8-2.13.4.jar.sha1 | 1 - .../jackson-datatype-jdk8-2.14.1.jar.sha1 | 1 + .../jackson-datatype-jsr310-2.13.4.jar.sha1 | 1 - .../jackson-datatype-jsr310-2.14.1.jar.sha1 | 1 + ...on-module-jaxb-annotations-2.13.4.jar.sha1 | 1 - ...on-module-jaxb-annotations-2.14.1.jar.sha1 | 1 + .../jackson-module-kotlin-2.13.4.jar.sha1 | 1 - .../jackson-module-kotlin-2.14.1.jar.sha1 | 1 + ...son-module-parameter-names-2.13.4.jar.sha1 | 1 - ...son-module-parameter-names-2.14.1.jar.sha1 | 1 + versions.lock | 30 +++++++++---------- versions.props | 2 +- 25 files changed, 29 insertions(+), 27 deletions(-) delete mode 100644 solr/licenses/jackson-annotations-2.13.4.jar.sha1 create mode 100644 solr/licenses/jackson-annotations-2.14.1.jar.sha1 delete mode 100644 solr/licenses/jackson-core-2.13.4.jar.sha1 create mode 100644 solr/licenses/jackson-core-2.14.1.jar.sha1 delete mode 100644 solr/licenses/jackson-databind-2.13.4.2.jar.sha1 create mode 100644 solr/licenses/jackson-databind-2.14.1.jar.sha1 delete mode 100644 solr/licenses/jackson-dataformat-cbor-2.13.4.jar.sha1 create mode 100644 solr/licenses/jackson-dataformat-cbor-2.14.1.jar.sha1 delete mode 100644 solr/licenses/jackson-dataformat-smile-2.13.4.jar.sha1 create mode 100644 solr/licenses/jackson-dataformat-smile-2.14.1.jar.sha1 delete mode 100644 solr/licenses/jackson-dataformat-xml-2.13.4.jar.sha1 create mode 100644 solr/licenses/jackson-dataformat-xml-2.14.1.jar.sha1 delete mode 100644 solr/licenses/jackson-datatype-jdk8-2.13.4.jar.sha1 create mode 100644 solr/licenses/jackson-datatype-jdk8-2.14.1.jar.sha1 delete mode 100644 solr/licenses/jackson-datatype-jsr310-2.13.4.jar.sha1 create mode 100644 solr/licenses/jackson-datatype-jsr310-2.14.1.jar.sha1 delete mode 100644 solr/licenses/jackson-module-jaxb-annotations-2.13.4.jar.sha1 create mode 100644 solr/licenses/jackson-module-jaxb-annotations-2.14.1.jar.sha1 delete mode 100644 solr/licenses/jackson-module-kotlin-2.13.4.jar.sha1 create mode 100644 solr/licenses/jackson-module-kotlin-2.14.1.jar.sha1 delete mode 100644 solr/licenses/jackson-module-parameter-names-2.13.4.jar.sha1 create mode 100644 solr/licenses/jackson-module-parameter-names-2.14.1.jar.sha1 diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 8575b0e0034..3514e6ee606 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -162,6 +162,8 @@ Other Changes * SOLR-16568: Upgrade woodstox-core to 6.4.0 (Kira Traynor) +* SOLR-16579: Upgrade Jackson to 2.14.1 (Kevin Risden) + ================== 9.1.0 ================== New Features diff --git a/solr/licenses/jackson-annotations-2.13.4.jar.sha1 b/solr/licenses/jackson-annotations-2.13.4.jar.sha1 deleted file mode 100644 index 396e92aed89..00000000000 --- a/solr/licenses/jackson-annotations-2.13.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -858c6cc78e1f08a885b1613e1d817c829df70a6e diff --git a/solr/licenses/jackson-annotations-2.14.1.jar.sha1 b/solr/licenses/jackson-annotations-2.14.1.jar.sha1 new file mode 100644 index 00000000000..057196abd81 --- /dev/null +++ b/solr/licenses/jackson-annotations-2.14.1.jar.sha1 @@ -0,0 +1 @@ +2a6ad504d591a7903ffdec76b5b7252819a2d162 diff --git a/solr/licenses/jackson-core-2.13.4.jar.sha1 b/solr/licenses/jackson-core-2.13.4.jar.sha1 deleted file mode 100644 index eff93324d03..00000000000 --- a/solr/licenses/jackson-core-2.13.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0cf934c681294b97ef6d80082faeefbe1edadf56 diff --git a/solr/licenses/jackson-core-2.14.1.jar.sha1 b/solr/licenses/jackson-core-2.14.1.jar.sha1 new file mode 100644 index 00000000000..afed0543002 --- /dev/null +++ b/solr/licenses/jackson-core-2.14.1.jar.sha1 @@ -0,0 +1 @@ +7a07bc535ccf0b7f6929c4d0f2ab9b294ef7c4a3 diff --git a/solr/licenses/jackson-databind-2.13.4.2.jar.sha1 b/solr/licenses/jackson-databind-2.13.4.2.jar.sha1 deleted file mode 100644 index 5aa5c2d8a8f..00000000000 --- a/solr/licenses/jackson-databind-2.13.4.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -325c06bdfeb628cfb80ebaaf1a26cc1eb558a585 diff --git a/solr/licenses/jackson-databind-2.14.1.jar.sha1 b/solr/licenses/jackson-databind-2.14.1.jar.sha1 new file mode 100644 index 00000000000..46739d94215 --- /dev/null +++ b/solr/licenses/jackson-databind-2.14.1.jar.sha1 @@ -0,0 +1 @@ +268524b9056cae1211b9f1f52560ef19347f4d17 diff --git a/solr/licenses/jackson-dataformat-cbor-2.13.4.jar.sha1 b/solr/licenses/jackson-dataformat-cbor-2.13.4.jar.sha1 deleted file mode 100644 index 1d75293b298..00000000000 --- a/solr/licenses/jackson-dataformat-cbor-2.13.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -ccaf21e6a02a20cae6591a12d20bf310544cf3ee diff --git a/solr/licenses/jackson-dataformat-cbor-2.14.1.jar.sha1 b/solr/licenses/jackson-dataformat-cbor-2.14.1.jar.sha1 new file mode 100644 index 00000000000..598985f8549 --- /dev/null +++ b/solr/licenses/jackson-dataformat-cbor-2.14.1.jar.sha1 @@ -0,0 +1 @@ +04e6fbcdcd2a01e4a5cb5901338cab6199c9b26b diff --git a/solr/licenses/jackson-dataformat-smile-2.13.4.jar.sha1 b/solr/licenses/jackson-dataformat-smile-2.13.4.jar.sha1 deleted file mode 100644 index 8230f231d5f..00000000000 --- a/solr/licenses/jackson-dataformat-smile-2.13.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -4161a7c3914a12e7b7940ea53eb3c53e17aea91b diff --git a/solr/licenses/jackson-dataformat-smile-2.14.1.jar.sha1 b/solr/licenses/jackson-dataformat-smile-2.14.1.jar.sha1 new file mode 100644 index 00000000000..1481c49368d --- /dev/null +++ b/solr/licenses/jackson-dataformat-smile-2.14.1.jar.sha1 @@ -0,0 +1 @@ +656ccecc1fc85b95d13e5b8080289fc1a5e5e21e diff --git a/solr/licenses/jackson-dataformat-xml-2.13.4.jar.sha1 b/solr/licenses/jackson-dataformat-xml-2.13.4.jar.sha1 deleted file mode 100644 index 33baaf3fc5b..00000000000 --- a/solr/licenses/jackson-dataformat-xml-2.13.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b739978806ffc80967ba0efe43b1296c29c4cfe8 diff --git a/solr/licenses/jackson-dataformat-xml-2.14.1.jar.sha1 b/solr/licenses/jackson-dataformat-xml-2.14.1.jar.sha1 new file mode 100644 index 00000000000..06909e10810 --- /dev/null +++ b/solr/licenses/jackson-dataformat-xml-2.14.1.jar.sha1 @@ -0,0 +1 @@ +ccd98bd674080338a6ca4bcdd52be7fb465cec1d diff --git a/solr/licenses/jackson-datatype-jdk8-2.13.4.jar.sha1 b/solr/licenses/jackson-datatype-jdk8-2.13.4.jar.sha1 deleted file mode 100644 index f7a8d7df60c..00000000000 --- a/solr/licenses/jackson-datatype-jdk8-2.13.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -557dbba5d8dfc7b7f944c58fe084109afcb5670b diff --git a/solr/licenses/jackson-datatype-jdk8-2.14.1.jar.sha1 b/solr/licenses/jackson-datatype-jdk8-2.14.1.jar.sha1 new file mode 100644 index 00000000000..aaab9a9e15d --- /dev/null +++ b/solr/licenses/jackson-datatype-jdk8-2.14.1.jar.sha1 @@ -0,0 +1 @@ +da194197d187bf24a8699514344ebf0abd7c342a diff --git a/solr/licenses/jackson-datatype-jsr310-2.13.4.jar.sha1 b/solr/licenses/jackson-datatype-jsr310-2.13.4.jar.sha1 deleted file mode 100644 index 31b29d076f8..00000000000 --- a/solr/licenses/jackson-datatype-jsr310-2.13.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0e6d820112871f33cd94a1dcc54eef58874753b5 diff --git a/solr/licenses/jackson-datatype-jsr310-2.14.1.jar.sha1 b/solr/licenses/jackson-datatype-jsr310-2.14.1.jar.sha1 new file mode 100644 index 00000000000..8a482d45c99 --- /dev/null +++ b/solr/licenses/jackson-datatype-jsr310-2.14.1.jar.sha1 @@ -0,0 +1 @@ +f24e8cb1437e05149b7a3049ebd6700f42e664b1 diff --git a/solr/licenses/jackson-module-jaxb-annotations-2.13.4.jar.sha1 b/solr/licenses/jackson-module-jaxb-annotations-2.13.4.jar.sha1 deleted file mode 100644 index 0c83342b9f9..00000000000 --- a/solr/licenses/jackson-module-jaxb-annotations-2.13.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -da90f334c1e752342f2dedb59880d5d46b29fe03 diff --git a/solr/licenses/jackson-module-jaxb-annotations-2.14.1.jar.sha1 b/solr/licenses/jackson-module-jaxb-annotations-2.14.1.jar.sha1 new file mode 100644 index 00000000000..9416b712f97 --- /dev/null +++ b/solr/licenses/jackson-module-jaxb-annotations-2.14.1.jar.sha1 @@ -0,0 +1 @@ +c986d9cc542fe5ade8aaebf5f0360a563dc51762 diff --git a/solr/licenses/jackson-module-kotlin-2.13.4.jar.sha1 b/solr/licenses/jackson-module-kotlin-2.13.4.jar.sha1 deleted file mode 100644 index 47b23d2e527..00000000000 --- a/solr/licenses/jackson-module-kotlin-2.13.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f9cfefe0d853fc5704e6e366d531c82a1f8c3881 diff --git a/solr/licenses/jackson-module-kotlin-2.14.1.jar.sha1 b/solr/licenses/jackson-module-kotlin-2.14.1.jar.sha1 new file mode 100644 index 00000000000..69986464fc8 --- /dev/null +++ b/solr/licenses/jackson-module-kotlin-2.14.1.jar.sha1 @@ -0,0 +1 @@ +9230908f5a521fc2afccdd62c50bb7bb9ef633a1 diff --git a/solr/licenses/jackson-module-parameter-names-2.13.4.jar.sha1 b/solr/licenses/jackson-module-parameter-names-2.13.4.jar.sha1 deleted file mode 100644 index 50042ca5892..00000000000 --- a/solr/licenses/jackson-module-parameter-names-2.13.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -858ccf6624b5fac6044813e845063edb6a62cf37 diff --git a/solr/licenses/jackson-module-parameter-names-2.14.1.jar.sha1 b/solr/licenses/jackson-module-parameter-names-2.14.1.jar.sha1 new file mode 100644 index 00000000000..e0aa778bea5 --- /dev/null +++ b/solr/licenses/jackson-module-parameter-names-2.14.1.jar.sha1 @@ -0,0 +1 @@ +2e05a86dba3d4b05074b6a313c4d5b7ff844c8dd diff --git a/versions.lock b/versions.lock index 3648ec1eb19..9bf040813c3 100644 --- a/versions.lock +++ b/versions.lock @@ -6,13 +6,13 @@ com.carrotsearch:hppc:0.9.1 (2 constraints: ad0fc9a6) com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.1 (2 constraints: cf1501e2) com.cybozu.labs:langdetect:1.1-20120112 (1 constraints: 5c066d5e) com.epam:parso:2.0.14 (1 constraints: 8e0c750e) -com.fasterxml.jackson:jackson-bom:2.13.4.20221013 (12 constraints: 07fa9222) -com.fasterxml.jackson.core:jackson-annotations:2.13.4 (10 constraints: 95be0c15) -com.fasterxml.jackson.core:jackson-core:2.13.4 (13 constraints: 3c026a27) -com.fasterxml.jackson.core:jackson-databind:2.13.4.2 (18 constraints: 3a6455da) -com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.13.4 (1 constraints: ba0ea766) -com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.13.4 (2 constraints: a624c1e0) -com.fasterxml.woodstox:woodstox-core:6.4.0 (3 constraints: af28dab7) +com.fasterxml.jackson:jackson-bom:2.14.1 (12 constraints: 36f86334) +com.fasterxml.jackson.core:jackson-annotations:2.14.1 (10 constraints: 89beae04) +com.fasterxml.jackson.core:jackson-core:2.14.1 (13 constraints: 2a028008) +com.fasterxml.jackson.core:jackson-databind:2.14.1 (18 constraints: c863ae0d) +com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.14.1 (1 constraints: b80ea766) +com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.14.1 (2 constraints: a42445e0) +com.fasterxml.woodstox:woodstox-core:6.4.0 (3 constraints: af28dcb7) com.github.ben-manes.caffeine:caffeine:3.1.1 (1 constraints: 0705fe35) com.github.jai-imageio:jai-imageio-core:1.4.0 (1 constraints: 5c0ced01) com.github.junrar:junrar:7.5.2 (1 constraints: 650c1002) @@ -107,7 +107,7 @@ io.prometheus:simpleclient_common:0.2.0 (1 constraints: e51014af) io.prometheus:simpleclient_httpserver:0.2.0 (1 constraints: 0405f135) io.sgr:s2-geometry-library-java:1.0.0 (1 constraints: b0107fb9) io.swagger.core.v3:swagger-annotations:2.2.2 (1 constraints: 0805fd35) -jakarta.activation:jakarta.activation-api:1.2.2 (2 constraints: ba28fcbd) +jakarta.activation:jakarta.activation-api:1.2.2 (2 constraints: bb282bbe) jakarta.annotation:jakarta.annotation-api:1.3.5 (4 constraints: d740f9a9) jakarta.validation:jakarta.validation-api:2.0.2 (1 constraints: fd10b6c3) jakarta.ws.rs:jakarta.ws.rs-api:2.1.6 (10 constraints: c1cce3ec) @@ -340,12 +340,12 @@ com.amazonaws:aws-java-sdk-core:1.12.15 (2 constraints: 501a5183) com.amazonaws:aws-java-sdk-kms:1.12.15 (1 constraints: d60cb42a) com.amazonaws:aws-java-sdk-s3:1.12.15 (1 constraints: e0125c30) com.amazonaws:jmespath-java:1.12.15 (2 constraints: 501a5183) -com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.13.4 (2 constraints: 601c12f1) -com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.13.4 (2 constraints: a719c812) -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.4 (2 constraints: 0c243982) -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4 (3 constraints: 7d3d5a10) -com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4 (2 constraints: a61d2f60) -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.4 (2 constraints: 0c243982) +com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.14.1 (2 constraints: 5e1c12f1) +com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.14.1 (2 constraints: a519c812) +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.1 (2 constraints: 0a24c381) +com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1 (3 constraints: 7b3d5a0f) +com.fasterxml.jackson.module:jackson-module-kotlin:2.14.1 (2 constraints: a41dd75f) +com.fasterxml.jackson.module:jackson-module-parameter-names:2.14.1 (2 constraints: 0a24c381) com.github.stephenc.jcip:jcip-annotations:1.0-1 (2 constraints: c5188bde) com.google.cloud:google-cloud-nio:0.124.14 (1 constraints: c90e1c7b) com.nimbusds:content-type:2.2 (1 constraints: d80b68eb) @@ -389,7 +389,7 @@ org.glassfish.jersey.test-framework:jersey-test-framework-core:2.35 (2 constrain org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:2.35 (1 constraints: de04fe30) org.hdrhistogram:HdrHistogram:2.1.12 (1 constraints: 520d2029) org.hsqldb:hsqldb:2.4.0 (1 constraints: 08050136) -org.jetbrains.kotlin:kotlin-reflect:1.6.10 (2 constraints: 602486e2) +org.jetbrains.kotlin:kotlin-reflect:1.6.10 (2 constraints: 6224e0e2) org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.0 (1 constraints: ae1013c2) org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.0 (2 constraints: 5e203d24) org.latencyutils:LatencyUtils:2.0.3 (1 constraints: 210dcd1b) diff --git a/versions.props b/versions.props index 95a10dc8226..431c8fe086a 100644 --- a/versions.props +++ b/versions.props @@ -3,7 +3,7 @@ com.adobe.testing:s3mock-junit4=2.1.34 com.carrotsearch.randomizedtesting:*=2.8.1 com.carrotsearch:hppc=0.9.1 com.cybozu.labs:langdetect=1.1-20120112 -com.fasterxml.jackson:jackson-bom=2.13.4.20221013 +com.fasterxml.jackson:jackson-bom=2.14.1 com.fasterxml.woodstox:woodstox-core=6.4.0 com.github.ben-manes.caffeine:caffeine=3.1.1 com.github.spotbugs:*=4.7.2 From 052304fc48d909570b6c84967f0e8d2af0303113 Mon Sep 17 00:00:00 2001 From: Kevin Risden Date: Wed, 7 Dec 2022 14:31:13 -0500 Subject: [PATCH 14/18] SOLR-16578: Upgrade to errorprone 2.16 --- solr/CHANGES.txt | 2 ++ .../src/java/org/apache/solr/core/backup/BackupManager.java | 2 +- solr/licenses/error_prone_annotations-2.15.0.jar.sha1 | 1 - solr/licenses/error_prone_annotations-2.16.jar.sha1 | 1 + versions.lock | 2 +- versions.props | 2 +- 6 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 solr/licenses/error_prone_annotations-2.15.0.jar.sha1 create mode 100644 solr/licenses/error_prone_annotations-2.16.jar.sha1 diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 3514e6ee606..a693d2f1ab5 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -137,6 +137,8 @@ Build * SOLR-16508: Upgrade gradle wrapper to 7.6 (Kevin Risden) +* SOLR-16578: Upgrade to errorprone 2.16 (Kevin Risden) + Other Changes --------------------- * SOLR-16545: Upgrade Carrot2 to 4.5.0 (Dawid Weiss) diff --git a/solr/core/src/java/org/apache/solr/core/backup/BackupManager.java b/solr/core/src/java/org/apache/solr/core/backup/BackupManager.java index 647886bca6a..faae2b9a70c 100644 --- a/solr/core/src/java/org/apache/solr/core/backup/BackupManager.java +++ b/solr/core/src/java/org/apache/solr/core/backup/BackupManager.java @@ -252,7 +252,7 @@ public void uploadConfigDir( String sourceConfigName, String targetConfigName, ConfigSetService configSetService) throws IOException { URI source = repository.resolveDirectory(getZkStateDir(), CONFIG_STATE_DIR, sourceConfigName); - Preconditions.checkState(repository.exists(source), "Path {} does not exist", source); + Preconditions.checkState(repository.exists(source), "Path %s does not exist", source); uploadConfigToSolrCloud(configSetService, source, targetConfigName, ""); } diff --git a/solr/licenses/error_prone_annotations-2.15.0.jar.sha1 b/solr/licenses/error_prone_annotations-2.15.0.jar.sha1 deleted file mode 100644 index 1d051d4a495..00000000000 --- a/solr/licenses/error_prone_annotations-2.15.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -38c8485a652f808c8c149150da4e5c2b0bd17f9a diff --git a/solr/licenses/error_prone_annotations-2.16.jar.sha1 b/solr/licenses/error_prone_annotations-2.16.jar.sha1 new file mode 100644 index 00000000000..26d24ce352b --- /dev/null +++ b/solr/licenses/error_prone_annotations-2.16.jar.sha1 @@ -0,0 +1 @@ +3fdb501b45ba22c6e9c0f2abdb6ed747a48c71af diff --git a/versions.lock b/versions.lock index 9bf040813c3..1c1af120864 100644 --- a/versions.lock +++ b/versions.lock @@ -34,7 +34,7 @@ com.google.cloud:google-cloud-core:2.8.6 (3 constraints: cc2e39e1) com.google.cloud:google-cloud-core-http:2.8.6 (1 constraints: f40ff795) com.google.cloud:google-cloud-storage:2.11.3 (2 constraints: cf1cb826) com.google.code.gson:gson:2.9.1 (6 constraints: d958afbf) -com.google.errorprone:error_prone_annotations:2.15.0 (4 constraints: 8a38f11d) +com.google.errorprone:error_prone_annotations:2.16 (4 constraints: 8a38f11d) com.google.guava:failureaccess:1.0.1 (2 constraints: f9199e37) com.google.guava:guava:31.1-jre (19 constraints: 5d28985f) com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava (2 constraints: 4b35b0a0) diff --git a/versions.props b/versions.props index 431c8fe086a..f96f92f1749 100644 --- a/versions.props +++ b/versions.props @@ -8,7 +8,7 @@ com.fasterxml.woodstox:woodstox-core=6.4.0 com.github.ben-manes.caffeine:caffeine=3.1.1 com.github.spotbugs:*=4.7.2 com.google.cloud:google-cloud-bom=0.178.0 -com.google.errorprone:*=2.15.0 +com.google.errorprone:*=2.16 com.google.guava:guava=31.1-jre com.google.re2j:re2j=1.2 com.jayway.jsonpath:json-path=2.7.0 From 8f0cd0e39369f6c3d629fe92faffcac0545f3830 Mon Sep 17 00:00:00 2001 From: Kevin Risden Date: Wed, 7 Dec 2022 14:38:46 -0500 Subject: [PATCH 15/18] SOLR-16562: Upgrade to Caffeine 3.1.2 --- solr/CHANGES.txt | 2 + solr/licenses/asm-9.3.jar.sha1 | 1 - solr/licenses/asm-9.4.jar.sha1 | 1 + solr/licenses/asm-analysis-7.2.jar.sha1 | 1 - solr/licenses/asm-commons-7.2.jar.sha1 | 1 - solr/licenses/asm-commons-9.4.jar.sha1 | 1 + solr/licenses/asm-tree-7.2.jar.sha1 | 1 - solr/licenses/asm-tree-9.4.jar.sha1 | 1 + solr/licenses/caffeine-3.1.1.jar.sha1 | 1 - solr/licenses/caffeine-3.1.2.jar.sha1 | 1 + solr/licenses/checker-qual-3.23.0.jar.sha1 | 1 - solr/licenses/checker-qual-3.27.0.jar.sha1 | 1 + solr/licenses/kotlin-reflect-1.6.10.jar.sha1 | 1 - solr/licenses/kotlin-reflect-1.7.21.jar.sha1 | 1 + solr/licenses/kotlin-stdlib-1.6.10.jar.sha1 | 1 - solr/licenses/kotlin-stdlib-1.7.21.jar.sha1 | 1 + .../kotlin-stdlib-common-1.6.10.jar.sha1 | 1 - .../kotlin-stdlib-common-1.7.21.jar.sha1 | 1 + .../kotlin-stdlib-jdk7-1.6.0.jar.sha1 | 1 - .../kotlin-stdlib-jdk7-1.7.21.jar.sha1 | 1 + .../kotlin-stdlib-jdk8-1.6.0.jar.sha1 | 1 - .../kotlin-stdlib-jdk8-1.7.21.jar.sha1 | 1 + solr/licenses/protobuf-java-3.21.4.jar.sha1 | 1 - solr/licenses/protobuf-java-3.21.8.jar.sha1 | 1 + solr/licenses/snakeyaml-1.28.jar.sha1 | 1 - solr/licenses/snakeyaml-1.33.jar.sha1 | 1 + versions.lock | 43 ++++++++++--------- versions.props | 2 +- 28 files changed, 37 insertions(+), 35 deletions(-) delete mode 100644 solr/licenses/asm-9.3.jar.sha1 create mode 100644 solr/licenses/asm-9.4.jar.sha1 delete mode 100644 solr/licenses/asm-analysis-7.2.jar.sha1 delete mode 100644 solr/licenses/asm-commons-7.2.jar.sha1 create mode 100644 solr/licenses/asm-commons-9.4.jar.sha1 delete mode 100644 solr/licenses/asm-tree-7.2.jar.sha1 create mode 100644 solr/licenses/asm-tree-9.4.jar.sha1 delete mode 100644 solr/licenses/caffeine-3.1.1.jar.sha1 create mode 100644 solr/licenses/caffeine-3.1.2.jar.sha1 delete mode 100644 solr/licenses/checker-qual-3.23.0.jar.sha1 create mode 100644 solr/licenses/checker-qual-3.27.0.jar.sha1 delete mode 100644 solr/licenses/kotlin-reflect-1.6.10.jar.sha1 create mode 100644 solr/licenses/kotlin-reflect-1.7.21.jar.sha1 delete mode 100644 solr/licenses/kotlin-stdlib-1.6.10.jar.sha1 create mode 100644 solr/licenses/kotlin-stdlib-1.7.21.jar.sha1 delete mode 100644 solr/licenses/kotlin-stdlib-common-1.6.10.jar.sha1 create mode 100644 solr/licenses/kotlin-stdlib-common-1.7.21.jar.sha1 delete mode 100644 solr/licenses/kotlin-stdlib-jdk7-1.6.0.jar.sha1 create mode 100644 solr/licenses/kotlin-stdlib-jdk7-1.7.21.jar.sha1 delete mode 100644 solr/licenses/kotlin-stdlib-jdk8-1.6.0.jar.sha1 create mode 100644 solr/licenses/kotlin-stdlib-jdk8-1.7.21.jar.sha1 delete mode 100644 solr/licenses/protobuf-java-3.21.4.jar.sha1 create mode 100644 solr/licenses/protobuf-java-3.21.8.jar.sha1 delete mode 100644 solr/licenses/snakeyaml-1.28.jar.sha1 create mode 100644 solr/licenses/snakeyaml-1.33.jar.sha1 diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index a693d2f1ab5..93d265199ca 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -166,6 +166,8 @@ Other Changes * SOLR-16579: Upgrade Jackson to 2.14.1 (Kevin Risden) +* SOLR-16562: Upgrade to Caffeine 3.1.2 (Kevin Risden) + ================== 9.1.0 ================== New Features diff --git a/solr/licenses/asm-9.3.jar.sha1 b/solr/licenses/asm-9.3.jar.sha1 deleted file mode 100644 index b20c901de24..00000000000 --- a/solr/licenses/asm-9.3.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -8e6300ef51c1d801a7ed62d07cd221aca3a90640 diff --git a/solr/licenses/asm-9.4.jar.sha1 b/solr/licenses/asm-9.4.jar.sha1 new file mode 100644 index 00000000000..b105357c21c --- /dev/null +++ b/solr/licenses/asm-9.4.jar.sha1 @@ -0,0 +1 @@ +b4e0e2d2e023aa317b7cfcfc916377ea348e07d1 diff --git a/solr/licenses/asm-analysis-7.2.jar.sha1 b/solr/licenses/asm-analysis-7.2.jar.sha1 deleted file mode 100644 index b0a8b7b83ed..00000000000 --- a/solr/licenses/asm-analysis-7.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b6e6abe057f23630113f4167c34bda7086691258 diff --git a/solr/licenses/asm-commons-7.2.jar.sha1 b/solr/licenses/asm-commons-7.2.jar.sha1 deleted file mode 100644 index 3db5daccb9b..00000000000 --- a/solr/licenses/asm-commons-7.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -ca2954e8d92a05bacc28ff465b25c70e0f512497 diff --git a/solr/licenses/asm-commons-9.4.jar.sha1 b/solr/licenses/asm-commons-9.4.jar.sha1 new file mode 100644 index 00000000000..aea1036a1dc --- /dev/null +++ b/solr/licenses/asm-commons-9.4.jar.sha1 @@ -0,0 +1 @@ +8fc2810ddbcbbec0a8bbccb3f8eda58321839912 diff --git a/solr/licenses/asm-tree-7.2.jar.sha1 b/solr/licenses/asm-tree-7.2.jar.sha1 deleted file mode 100644 index 077d6f9c411..00000000000 --- a/solr/licenses/asm-tree-7.2.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -3a23cc36edaf8fc5a89cb100182758ccb5991487 diff --git a/solr/licenses/asm-tree-9.4.jar.sha1 b/solr/licenses/asm-tree-9.4.jar.sha1 new file mode 100644 index 00000000000..e4c5d6721a5 --- /dev/null +++ b/solr/licenses/asm-tree-9.4.jar.sha1 @@ -0,0 +1 @@ +a99175a17d7fdc18cbcbd0e8ea6a5d276844190a diff --git a/solr/licenses/caffeine-3.1.1.jar.sha1 b/solr/licenses/caffeine-3.1.1.jar.sha1 deleted file mode 100644 index 3458e9cf18d..00000000000 --- a/solr/licenses/caffeine-3.1.1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b08f9f234ae51adf8b7a3dcdfcf115aa258fafcb diff --git a/solr/licenses/caffeine-3.1.2.jar.sha1 b/solr/licenses/caffeine-3.1.2.jar.sha1 new file mode 100644 index 00000000000..514db6a30b8 --- /dev/null +++ b/solr/licenses/caffeine-3.1.2.jar.sha1 @@ -0,0 +1 @@ +c79828183e8bfa014cf3287b1aa5200cba18091b diff --git a/solr/licenses/checker-qual-3.23.0.jar.sha1 b/solr/licenses/checker-qual-3.23.0.jar.sha1 deleted file mode 100644 index 7d89426df6f..00000000000 --- a/solr/licenses/checker-qual-3.23.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -2ce274da87ae21d940ded7b827d9069206ea3001 diff --git a/solr/licenses/checker-qual-3.27.0.jar.sha1 b/solr/licenses/checker-qual-3.27.0.jar.sha1 new file mode 100644 index 00000000000..1d44d8f19db --- /dev/null +++ b/solr/licenses/checker-qual-3.27.0.jar.sha1 @@ -0,0 +1 @@ +331f93a364f95a05888419b4e138d27cd774206a diff --git a/solr/licenses/kotlin-reflect-1.6.10.jar.sha1 b/solr/licenses/kotlin-reflect-1.6.10.jar.sha1 deleted file mode 100644 index c8ade6487d9..00000000000 --- a/solr/licenses/kotlin-reflect-1.6.10.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -1cbe9c92c12a94eea200d23c2bbaedaf3daf5132 diff --git a/solr/licenses/kotlin-reflect-1.7.21.jar.sha1 b/solr/licenses/kotlin-reflect-1.7.21.jar.sha1 new file mode 100644 index 00000000000..5e2338faf3a --- /dev/null +++ b/solr/licenses/kotlin-reflect-1.7.21.jar.sha1 @@ -0,0 +1 @@ +0ad6d09bc4db0eab1069112eea8ebea0be7be44f diff --git a/solr/licenses/kotlin-stdlib-1.6.10.jar.sha1 b/solr/licenses/kotlin-stdlib-1.6.10.jar.sha1 deleted file mode 100644 index 00143844d50..00000000000 --- a/solr/licenses/kotlin-stdlib-1.6.10.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b8af3fe6f1ca88526914929add63cf5e7c5049af diff --git a/solr/licenses/kotlin-stdlib-1.7.21.jar.sha1 b/solr/licenses/kotlin-stdlib-1.7.21.jar.sha1 new file mode 100644 index 00000000000..1aa718259bb --- /dev/null +++ b/solr/licenses/kotlin-stdlib-1.7.21.jar.sha1 @@ -0,0 +1 @@ +1a2eaf898a0dda83037034b10a42053cf8a7caf8 diff --git a/solr/licenses/kotlin-stdlib-common-1.6.10.jar.sha1 b/solr/licenses/kotlin-stdlib-common-1.6.10.jar.sha1 deleted file mode 100644 index d5026581101..00000000000 --- a/solr/licenses/kotlin-stdlib-common-1.6.10.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0c118700e3a33c8a0d9adc920e9dec0831171925 diff --git a/solr/licenses/kotlin-stdlib-common-1.7.21.jar.sha1 b/solr/licenses/kotlin-stdlib-common-1.7.21.jar.sha1 new file mode 100644 index 00000000000..cb95a2cf6d0 --- /dev/null +++ b/solr/licenses/kotlin-stdlib-common-1.7.21.jar.sha1 @@ -0,0 +1 @@ +cb02257de8e13e8498f8e2f69f742f2d438e794d diff --git a/solr/licenses/kotlin-stdlib-jdk7-1.6.0.jar.sha1 b/solr/licenses/kotlin-stdlib-jdk7-1.6.0.jar.sha1 deleted file mode 100644 index a48893479ee..00000000000 --- a/solr/licenses/kotlin-stdlib-jdk7-1.6.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -da6bdc87391322974a43ccc00a25536ae74dad51 diff --git a/solr/licenses/kotlin-stdlib-jdk7-1.7.21.jar.sha1 b/solr/licenses/kotlin-stdlib-jdk7-1.7.21.jar.sha1 new file mode 100644 index 00000000000..35ffd5ad4ce --- /dev/null +++ b/solr/licenses/kotlin-stdlib-jdk7-1.7.21.jar.sha1 @@ -0,0 +1 @@ +a0ba09615c2213d580315e234b3febfea25b757e diff --git a/solr/licenses/kotlin-stdlib-jdk8-1.6.0.jar.sha1 b/solr/licenses/kotlin-stdlib-jdk8-1.6.0.jar.sha1 deleted file mode 100644 index 50cd854fef6..00000000000 --- a/solr/licenses/kotlin-stdlib-jdk8-1.6.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -baf82c475e9372c25407f3d132439e4aa803b8b8 diff --git a/solr/licenses/kotlin-stdlib-jdk8-1.7.21.jar.sha1 b/solr/licenses/kotlin-stdlib-jdk8-1.7.21.jar.sha1 new file mode 100644 index 00000000000..ebce2c4c0a1 --- /dev/null +++ b/solr/licenses/kotlin-stdlib-jdk8-1.7.21.jar.sha1 @@ -0,0 +1 @@ +5407c3593c58860cec5ee3f66c468396b42f4c2b diff --git a/solr/licenses/protobuf-java-3.21.4.jar.sha1 b/solr/licenses/protobuf-java-3.21.4.jar.sha1 deleted file mode 100644 index 7a2fa3257e4..00000000000 --- a/solr/licenses/protobuf-java-3.21.4.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -9947febd7a6d0695726c78f603a149b7b7c108e0 diff --git a/solr/licenses/protobuf-java-3.21.8.jar.sha1 b/solr/licenses/protobuf-java-3.21.8.jar.sha1 new file mode 100644 index 00000000000..d88ce20792b --- /dev/null +++ b/solr/licenses/protobuf-java-3.21.8.jar.sha1 @@ -0,0 +1 @@ +2a1eebb74b844d9ccdf1d22eb2f57cec709698a9 diff --git a/solr/licenses/snakeyaml-1.28.jar.sha1 b/solr/licenses/snakeyaml-1.28.jar.sha1 deleted file mode 100644 index 879e89213e8..00000000000 --- a/solr/licenses/snakeyaml-1.28.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7cae037c3014350c923776548e71c9feb7a69259 diff --git a/solr/licenses/snakeyaml-1.33.jar.sha1 b/solr/licenses/snakeyaml-1.33.jar.sha1 new file mode 100644 index 00000000000..ee3719e3931 --- /dev/null +++ b/solr/licenses/snakeyaml-1.33.jar.sha1 @@ -0,0 +1 @@ +2cd0a87ff7df953f810c344bdf2fe3340b954c69 diff --git a/versions.lock b/versions.lock index 1c1af120864..628b0e2aa52 100644 --- a/versions.lock +++ b/versions.lock @@ -1,19 +1,19 @@ # Run ./gradlew --write-locks to regenerate this file biz.aQute.bnd:biz.aQute.bnd.annotation:6.3.1 (1 constraints: 0c051336) com.adobe.xmp:xmpcore:6.1.10 (1 constraints: fd0d5947) -com.beust:jcommander:1.82 (2 constraints: 2b123714) +com.beust:jcommander:1.82 (3 constraints: fd21d419) com.carrotsearch:hppc:0.9.1 (2 constraints: ad0fc9a6) com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.1 (2 constraints: cf1501e2) com.cybozu.labs:langdetect:1.1-20120112 (1 constraints: 5c066d5e) com.epam:parso:2.0.14 (1 constraints: 8e0c750e) -com.fasterxml.jackson:jackson-bom:2.14.1 (12 constraints: 36f86334) +com.fasterxml.jackson:jackson-bom:2.14.1 (13 constraints: 7208a870) com.fasterxml.jackson.core:jackson-annotations:2.14.1 (10 constraints: 89beae04) com.fasterxml.jackson.core:jackson-core:2.14.1 (13 constraints: 2a028008) com.fasterxml.jackson.core:jackson-databind:2.14.1 (18 constraints: c863ae0d) com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.14.1 (1 constraints: b80ea766) com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.14.1 (2 constraints: a42445e0) com.fasterxml.woodstox:woodstox-core:6.4.0 (3 constraints: af28dcb7) -com.github.ben-manes.caffeine:caffeine:3.1.1 (1 constraints: 0705fe35) +com.github.ben-manes.caffeine:caffeine:3.1.2 (1 constraints: 0805ff35) com.github.jai-imageio:jai-imageio-core:1.4.0 (1 constraints: 5c0ced01) com.github.junrar:junrar:7.5.2 (1 constraints: 650c1002) com.github.openjson:openjson:1.0.12 (1 constraints: 8b0c6d0e) @@ -34,7 +34,7 @@ com.google.cloud:google-cloud-core:2.8.6 (3 constraints: cc2e39e1) com.google.cloud:google-cloud-core-http:2.8.6 (1 constraints: f40ff795) com.google.cloud:google-cloud-storage:2.11.3 (2 constraints: cf1cb826) com.google.code.gson:gson:2.9.1 (6 constraints: d958afbf) -com.google.errorprone:error_prone_annotations:2.16 (4 constraints: 8a38f11d) +com.google.errorprone:error_prone_annotations:2.16 (4 constraints: 2e389ad2) com.google.guava:failureaccess:1.0.1 (2 constraints: f9199e37) com.google.guava:guava:31.1-jre (19 constraints: 5d28985f) com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava (2 constraints: 4b35b0a0) @@ -45,7 +45,7 @@ com.google.http-client:google-http-client-gson:1.42.2 (6 constraints: e6619899) com.google.http-client:google-http-client-jackson2:1.42.2 (1 constraints: 1d1003a6) com.google.j2objc:j2objc-annotations:1.3 (4 constraints: 7d3ab454) com.google.oauth-client:google-oauth-client:1.34.1 (2 constraints: b520b575) -com.google.protobuf:protobuf-java:3.21.4 (9 constraints: 3183ce88) +com.google.protobuf:protobuf-java:3.21.8 (10 constraints: 649360d7) com.google.protobuf:protobuf-java-util:3.21.4 (3 constraints: 332b642b) com.google.re2j:re2j:1.2 (1 constraints: a7041c2c) com.googlecode.json-simple:json-simple:1.1.1 (2 constraints: 321c78d2) @@ -134,7 +134,7 @@ org.apache.commons:commons-csv:1.9.0 (1 constraints: 610cfc01) org.apache.commons:commons-exec:1.3 (2 constraints: a41056b8) org.apache.commons:commons-lang3:3.12.0 (5 constraints: 9b3e0e36) org.apache.commons:commons-math3:3.6.1 (4 constraints: 93247039) -org.apache.commons:commons-text:1.10.0 (2 constraints: 861680f8) +org.apache.commons:commons-text:1.10.0 (3 constraints: ad262ca9) org.apache.curator:curator-client:4.3.0 (2 constraints: e214cba2) org.apache.curator:curator-framework:4.3.0 (2 constraints: ff13b474) org.apache.curator:curator-recipes:4.3.0 (1 constraints: 09050836) @@ -144,7 +144,7 @@ org.apache.hadoop:hadoop-client-api:3.3.4 (3 constraints: 1f28da5f) org.apache.hadoop:hadoop-client-runtime:3.3.4 (2 constraints: 6b177043) org.apache.hadoop:hadoop-common:3.3.4 (1 constraints: 0c050736) org.apache.hadoop.thirdparty:hadoop-shaded-guava:1.1.1 (1 constraints: 0505f435) -org.apache.httpcomponents:httpclient:4.5.13 (9 constraints: 5d801b3e) +org.apache.httpcomponents:httpclient:4.5.13 (10 constraints: 8f9027a9) org.apache.httpcomponents:httpcore:4.4.15 (8 constraints: 1c6d2913) org.apache.httpcomponents:httpmime:4.5.13 (3 constraints: ea1bb9dc) org.apache.httpcomponents.client5:httpclient5:5.1.3 (1 constraints: 6c10bcb3) @@ -219,7 +219,7 @@ org.apiguardian:apiguardian-api:1.1.2 (2 constraints: 601bd5a8) org.bitbucket.b_c:jose4j:0.7.9 (1 constraints: 12050936) org.bouncycastle:bcmail-jdk15on:1.70 (1 constraints: 310c8af5) org.bouncycastle:bcpkix-jdk15on:1.70 (2 constraints: ce1b11b3) -org.bouncycastle:bcprov-jdk15on:1.70 (4 constraints: 1f34ee12) +org.bouncycastle:bcprov-jdk15on:1.70 (5 constraints: ee43a815) org.bouncycastle:bcutil-jdk15on:1.70 (2 constraints: 961ad454) org.brotli:dec:0.1.2 (1 constraints: 5a0ce101) org.carrot2:carrot2-core:4.5.0 (1 constraints: 0b050e36) @@ -227,7 +227,7 @@ org.carrot2:morfologik-fsa:2.1.9 (1 constraints: db0d9c36) org.carrot2:morfologik-polish:2.1.9 (1 constraints: d312541e) org.carrot2:morfologik-stemming:2.1.9 (2 constraints: d81fb300) org.ccil.cowan.tagsoup:tagsoup:1.2.1 (1 constraints: 5b0ce801) -org.checkerframework:checker-qual:3.23.0 (5 constraints: 524636e8) +org.checkerframework:checker-qual:3.27.0 (5 constraints: 574674eb) org.codehaus.janino:commons-compiler:3.1.8 (2 constraints: 2f1983ec) org.codehaus.janino:janino:3.1.8 (1 constraints: 640dbc2c) org.codehaus.woodstox:stax2-api:4.2.1 (2 constraints: 36152eaf) @@ -280,9 +280,10 @@ org.javassist:javassist:3.25.0-GA (1 constraints: 2a110ef1) org.jctools:jctools-core:3.3.0 (1 constraints: 08050336) org.jdom:jdom2:2.0.6.1 (1 constraints: be0c371b) org.jetbrains:annotations:13.0 (1 constraints: df0e795c) -org.jetbrains.kotlin:kotlin-stdlib:1.6.10 (6 constraints: b456d578) -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.10 (3 constraints: 852a7097) -org.junit:junit-bom:5.9.0 (1 constraints: c7116dde) +org.jetbrains.kotlin:kotlin-bom:1.7.21 (1 constraints: 31109caf) +org.jetbrains.kotlin:kotlin-stdlib:1.7.21 (7 constraints: 1e659044) +org.jetbrains.kotlin:kotlin-stdlib-common:1.7.21 (4 constraints: 873864a4) +org.junit:junit-bom:5.9.1 (2 constraints: cb21f18e) org.locationtech.jts:jts-core:1.19.0 (2 constraints: a31de760) org.locationtech.jts.io:jts-io-common:1.19.0 (1 constraints: 930d513a) org.locationtech.proj4j:proj4j:1.1.5 (1 constraints: 5f0daf2c) @@ -292,10 +293,10 @@ org.openjdk.jmh:jmh-core:1.32 (1 constraints: da04f730) org.osgi:org.osgi.resource:1.0.0 (1 constraints: e60f2999) org.osgi:org.osgi.service.serviceloader:1.0.0 (1 constraints: e60f2999) org.osgi:osgi.annotation:8.1.0 (1 constraints: 0b051636) -org.ow2.asm:asm:9.3 (5 constraints: e139bef1) -org.ow2.asm:asm-analysis:7.2 (1 constraints: e409d9a5) -org.ow2.asm:asm-commons:7.2 (1 constraints: 6b0f7267) -org.ow2.asm:asm-tree:7.2 (2 constraints: 2f14468c) +org.ow2.asm:asm:9.4 (6 constraints: 1242e83d) +org.ow2.asm:asm-bom:9.4 (1 constraints: a50fb27f) +org.ow2.asm:asm-commons:9.4 (2 constraints: 94171c72) +org.ow2.asm:asm-tree:9.4 (2 constraints: 11129514) org.quicktheories:quicktheories:0.26 (1 constraints: dc04f530) org.reactivestreams:reactive-streams:1.0.3 (3 constraints: 3c2b02fd) org.semver4j:semver4j:2.2.0 (1 constraints: 0605fb35) @@ -330,7 +331,7 @@ software.amazon.awssdk:third-party-jackson-core:2.17.63 (2 constraints: 931b14a8 software.amazon.awssdk:utils:2.17.63 (17 constraints: 0bffaaab) software.amazon.eventstream:eventstream:1.0.1 (2 constraints: 2e1ae62b) ua.net.nlp:morfologik-ukrainian-search:4.9.1 (1 constraints: d5126e1e) -xerces:xercesImpl:2.12.2 (1 constraints: 8e0c7d0e) +xerces:xercesImpl:2.12.2 (2 constraints: ba1cc124) [Test dependencies] com.adobe.testing:s3mock:2.1.34 (1 constraints: b012831d) @@ -389,9 +390,9 @@ org.glassfish.jersey.test-framework:jersey-test-framework-core:2.35 (2 constrain org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2:2.35 (1 constraints: de04fe30) org.hdrhistogram:HdrHistogram:2.1.12 (1 constraints: 520d2029) org.hsqldb:hsqldb:2.4.0 (1 constraints: 08050136) -org.jetbrains.kotlin:kotlin-reflect:1.6.10 (2 constraints: 6224e0e2) -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.0 (1 constraints: ae1013c2) -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.0 (2 constraints: 5e203d24) +org.jetbrains.kotlin:kotlin-reflect:1.7.21 (3 constraints: 61328ffd) +org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21 (2 constraints: e11ec2c7) +org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21 (3 constraints: 5d2e399a) org.latencyutils:LatencyUtils:2.0.3 (1 constraints: 210dcd1b) org.mockito:mockito-core:3.8.0 (1 constraints: 0d051236) org.objenesis:objenesis:3.1 (1 constraints: b00a12bd) @@ -413,6 +414,6 @@ org.springframework.boot:spring-boot-starter-jetty:2.5.14 (1 constraints: 1d0d31 org.springframework.boot:spring-boot-starter-json:2.5.14 (1 constraints: d814609e) org.springframework.boot:spring-boot-starter-logging:2.5.14 (1 constraints: 6d138546) org.springframework.boot:spring-boot-starter-web:2.5.14 (1 constraints: 1d0d3137) -org.yaml:snakeyaml:1.28 (1 constraints: 0e13df1f) +org.yaml:snakeyaml:1.33 (2 constraints: dc224ce5) software.amazon.awssdk:url-connection-client:2.17.63 (2 constraints: 471f19f7) software.amazon.ion:ion-java:1.0.2 (1 constraints: 720db831) diff --git a/versions.props b/versions.props index f96f92f1749..2958612a608 100644 --- a/versions.props +++ b/versions.props @@ -5,7 +5,7 @@ com.carrotsearch:hppc=0.9.1 com.cybozu.labs:langdetect=1.1-20120112 com.fasterxml.jackson:jackson-bom=2.14.1 com.fasterxml.woodstox:woodstox-core=6.4.0 -com.github.ben-manes.caffeine:caffeine=3.1.1 +com.github.ben-manes.caffeine:caffeine=3.1.2 com.github.spotbugs:*=4.7.2 com.google.cloud:google-cloud-bom=0.178.0 com.google.errorprone:*=2.16 From 46bce2382f8c4a5556b6c4f00754d3a764b973c2 Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Thu, 8 Dec 2022 11:38:10 -0500 Subject: [PATCH 16/18] SOLR-10458: setFollowRedirects should be deprecated in favor of Solr Client Builder methods (#1216) Fix followRedirect property on HttpSolrClient not set when using Builder pattern. Migrated tests to use Builder. --- solr/CHANGES.txt | 2 ++ .../client/solrj/impl/HttpSolrClient.java | 4 ++- .../solrj/impl/BasicHttpSolrClientTest.java | 20 +++++++---- .../solrj/impl/Http2SolrClientTest.java | 36 +++++++++---------- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 93d265199ca..4fc745ab91a 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -125,6 +125,8 @@ Bug Fixes * SOLR-16473: Fix race condition in shard split when a sub-shard is put in recovery state. (Andy Vuong via Bruno Roustant) +* SOLR-10458: Fix followRedirect property on HttpSolrClient not set when using Builder pattern. (Eric Pugh) + Build --------------------- * Upgrade forbiddenapis to 3.4 (Uwe Schindler) diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java index c13076337aa..79d01a5c4f4 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClient.java @@ -165,11 +165,13 @@ protected HttpSolrClient(Builder builder) { } if (builder.httpClient != null) { + this.internalClient = false; this.followRedirects = builder.followRedirects; this.httpClient = builder.httpClient; - this.internalClient = false; + } else { this.internalClient = true; + this.followRedirects = builder.followRedirects; ModifiableSolrParams params = new ModifiableSolrParams(); params.set(HttpClientUtil.PROP_FOLLOW_REDIRECTS, followRedirects); params.set(HttpClientUtil.PROP_ALLOW_COMPRESSION, builder.compression); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java index c59085bb0e6..11d59297d3d 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java @@ -542,18 +542,24 @@ public void testUpdate() throws Exception { @Test public void testRedirect() throws Exception { final String clientUrl = jetty.getBaseUrl().toString() + "/redirect/foo"; - try (HttpSolrClient client = getHttpSolrClient(clientUrl)) { - SolrQuery q = new SolrQuery("*:*"); - // default = false + SolrQuery q = new SolrQuery("*:*"); + + // default for redirect is false. + try (HttpSolrClient client = new HttpSolrClient.Builder(clientUrl).build()) { SolrServerException e = expectThrows(SolrServerException.class, () -> client.query(q)); assertTrue(e.getMessage().contains("redirect")); + } - client.setFollowRedirects(true); + try (HttpSolrClient client = + new HttpSolrClient.Builder(clientUrl).withFollowRedirects(true).build()) { + // No exception expected client.query(q); + } - // And back again: - client.setFollowRedirects(false); - e = expectThrows(SolrServerException.class, () -> client.query(q)); + // And with explicit false: + try (HttpSolrClient client = + new HttpSolrClient.Builder(clientUrl).withFollowRedirects(false).build()) { + SolrServerException e = expectThrows(SolrServerException.class, () -> client.query(q)); assertTrue(e.getMessage().contains("redirect")); } } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java index d53b86c45f9..e08b12f8a3f 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/Http2SolrClientTest.java @@ -575,27 +575,27 @@ public void testDoNotFollowRedirect() throws Exception { @Test public void testRedirectSwapping() throws Exception { final String clientUrl = jetty.getBaseUrl().toString() + "/redirect/foo"; - try (Http2SolrClient client = getHttp2SolrClient(clientUrl)) { - SolrQuery q = new SolrQuery("*:*"); - // default = false - try { - client.query(q); - fail("Should have thrown an exception."); - } catch (SolrServerException e) { - assertTrue(e.getMessage().contains("redirect")); - } + SolrQuery q = new SolrQuery("*:*"); + + // default for follow redirects is false + try (Http2SolrClient client = new Http2SolrClient.Builder(clientUrl).build()) { + + SolrServerException e = expectThrows(SolrServerException.class, () -> client.query(q)); + assertTrue(e.getMessage().contains("redirect")); + } - client.setFollowRedirects(true); + try (Http2SolrClient client = + new Http2SolrClient.Builder(clientUrl).withFollowRedirects(true).build()) { + // shouldn't throw an exception client.query(q); + } - // And back again: - client.setFollowRedirects(false); - try { - client.query(q); - fail("Should have thrown an exception."); - } catch (SolrServerException e) { - assertTrue(e.getMessage().contains("redirect")); - } + // set explicit false for following redirects + try (Http2SolrClient client = + new Http2SolrClient.Builder(clientUrl).withFollowRedirects(false).build()) { + + SolrServerException e = expectThrows(SolrServerException.class, () -> client.query(q)); + assertTrue(e.getMessage().contains("redirect")); } } From 4885d67c82d51ee83a7aa0b263bf05750e67f07e Mon Sep 17 00:00:00 2001 From: Nick Ginther <104029658+nginthfs@users.noreply.github.com> Date: Thu, 8 Dec 2022 19:40:24 -0600 Subject: [PATCH 17/18] SOLR-16569: Add java system property to overseer queue size (#1205) --- solr/CHANGES.txt | 2 ++ solr/core/src/java/org/apache/solr/cloud/Overseer.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 4fc745ab91a..d2947d492a2 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -170,6 +170,8 @@ Other Changes * SOLR-16562: Upgrade to Caffeine 3.1.2 (Kevin Risden) +* SOLR-16569: Add java system property to overseer queue size (Nick Ginther via noble) + ================== 9.1.0 ================== New Features diff --git a/solr/core/src/java/org/apache/solr/cloud/Overseer.java b/solr/core/src/java/org/apache/solr/cloud/Overseer.java index 28a644fb0e3..db633e315bc 100644 --- a/solr/core/src/java/org/apache/solr/cloud/Overseer.java +++ b/solr/core/src/java/org/apache/solr/cloud/Overseer.java @@ -152,7 +152,8 @@ public class Overseer implements SolrCloseable { public static final int STATE_UPDATE_DELAY = ZkStateReader.STATE_UPDATE_DELAY; public static final int STATE_UPDATE_BATCH_SIZE = Integer.getInteger("solr.OverseerStateUpdateBatchSize", 10000); - public static final int STATE_UPDATE_MAX_QUEUE = 20000; + public static final int STATE_UPDATE_MAX_QUEUE = + Integer.getInteger("solr.OverseerStateUpdateMaxQueueSize", 20000); public static final int NUM_RESPONSES_TO_STORE = 10000; public static final String OVERSEER_ELECT = "/overseer_elect"; From 37c34664bab9a5d6df9ba6f3544d09432845aa51 Mon Sep 17 00:00:00 2001 From: Kevin Risden Date: Fri, 9 Dec 2022 13:37:34 -0500 Subject: [PATCH 18/18] SOLR-16581: Upgrade OWASP dependency check to 7.4.1 (#1226) --- build.gradle | 2 +- .../validation/owasp-dependency-check.gradle | 4 ++-- .../owasp-dependency-check/exclusions.xml | 21 +++++++++++++++++++ solr/CHANGES.txt | 2 ++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index cff2bdb19dd..e0f4b2655d2 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ import java.time.format.DateTimeFormatter plugins { id "base" id "com.palantir.consistent-versions" version "2.11.0" - id "org.owasp.dependencycheck" version "7.2.0" + id "org.owasp.dependencycheck" version "7.4.1" id 'ca.cutterslade.analyze' version "1.9.0" id 'de.thetaphi.forbiddenapis' version '3.4' apply false id "de.undercouch.download" version "5.2.0" apply false diff --git a/gradle/validation/owasp-dependency-check.gradle b/gradle/validation/owasp-dependency-check.gradle index d58fd8bfd10..6d76e9cb7ff 100644 --- a/gradle/validation/owasp-dependency-check.gradle +++ b/gradle/validation/owasp-dependency-check.gradle @@ -25,9 +25,9 @@ def resources = scriptResources(buildscript) configure(rootProject) { dependencyCheck { failBuildOnCVSS = propertyOrDefault("validation.owasp.threshold", 7) as Integer - formats = ['HTML', 'JSON'] + formats = ['ALL'] skipProjects = [':solr:solr-ref-guide'] - skipConfigurations = ['unifiedClasspath'] + skipConfigurations = ['unifiedClasspath', 'permitUnusedDeclared'] suppressionFile = file("${resources}/exclusions.xml") } diff --git a/gradle/validation/owasp-dependency-check/exclusions.xml b/gradle/validation/owasp-dependency-check/exclusions.xml index 261f52ddf2c..7043d611ebb 100644 --- a/gradle/validation/owasp-dependency-check/exclusions.xml +++ b/gradle/validation/owasp-dependency-check/exclusions.xml @@ -51,4 +51,25 @@ ^pkg:maven/org\.carrot2\.shaded/carrot2\-guava@.*$ cpe:/a:google:guava + + + ^pkg:maven/org\.apache\.calcite\.avatica/.*@.*$ + cpe:/a:apache:calcite + + + + ^pkg:maven/org\.eclipse\.jetty\.toolchain/jetty\-servlet\-api@.*$ + cpe:/a:eclipse:jetty + cpe:/a:jetty:jetty + + + + ^pkg:maven/org\.apache\.hadoop\.thirdparty/hadoop\-shaded\-guava@.*$ + cpe:/a:apache:hadoop:1.1.1 + + + + ^pkg:maven/org\.apache\.hadoop/hadoop\-client\-runtime@3.*$ + cpe:/a:apache:hadoop:1.1.1 + diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index d2947d492a2..44ece16aa8f 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -141,6 +141,8 @@ Build * SOLR-16578: Upgrade to errorprone 2.16 (Kevin Risden) +* SOLR-16581: Upgrade OWASP dependency check to 7.4.1 (Kevin Risden) + Other Changes --------------------- * SOLR-16545: Upgrade Carrot2 to 4.5.0 (Dawid Weiss)