-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling BAD_REQUEST exceptions as failures even with shard.tolerant as true #139
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,10 @@ void setResponseCode(int rspCode) { | |
this.rspCode = rspCode; | ||
} | ||
|
||
public int getRspCode() { | ||
return rspCode; | ||
} | ||
|
||
Comment on lines
+84
to
+87
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 surprising that this wasn't already accessible! Seems pretty general-purpose useful. |
||
void setNodeName(String nodeName) { | ||
this.nodeName = nodeName; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -360,6 +360,19 @@ public void testLuceneIOExceptionHandling() throws Exception { | |
assertTrue( | ||
e.getMessage() | ||
.contains("Query contains too many nested clauses; maxClauseCount is set to 1")); | ||
|
||
solrQuery = new SolrQuery("{!surround maxBasicQueries=1000 df=title}10W(tes*,test*)"); | ||
solrQuery.add(ShardParams.SHARDS_TOLERANT, "true"); | ||
final QueryRequest req4 = new QueryRequest(solrQuery); | ||
req4.setMethod(SolrRequest.METHOD.POST); | ||
e = | ||
assertThrows( | ||
BaseHttpSolrClient.RemoteSolrException.class, | ||
() -> req4.process(cloudSolrClient, collectionName)); | ||
assertEquals(400, e.code()); | ||
assertTrue( | ||
e.getMessage() | ||
.contains("Query contains too many nested clauses; maxClauseCount is set to 1")); | ||
Comment on lines
+363
to
+375
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. curious: with a mini solr cluster of size 1, wouldn't this request have failed even before this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even with the cluster of size 1, it still flows through the distributed query section of the SearchHandler and previously did not result in an error, but would just return no results and partial results as true. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, nice! so it was very tolerant before 😁 |
||
} finally { | ||
if (initialMaxBooleanClauses != null) { | ||
System.setProperty("solr.max.booleanClauses", initialMaxBooleanClauses); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just make this a Set -- i.e.
Set<> X = Set.of()
-- avoid the extra import. For a list of size 1 it's not going to matter much, but you're doing "set-like things" on this anyway, so there's little purpose served in going broader and making it a Collection.