Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelog/unreleased/SOLR-18176-shardhandler-bottleneck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Increased query throughput by removing a call to ZooKeeper for cluster state that should have been cached
type: fixed
authors:
- name: Matthew Biscocho
links:
- name: SOLR-18176
url: https://issues.apache.org/jira/browse/SOLR-18176
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ private void withShardsParam(Builder builder, String shardsParam) {
if (sliceOrUrl.indexOf('/') < 0) {
// this is a logical shard
this.slices[i] = sliceOrUrl;
replicas[i] =
findReplicas(
builder,
shardsParam,
clusterState,
clusterState.getCollection(builder.collection).getSlice(sliceOrUrl));
DocCollection coll = clusterState.getCollectionOrNull(builder.collection, true);
if (coll == null) {
throw new SolrException(
SolrException.ErrorCode.BAD_REQUEST,
"Could not find collection to resolve replicas: " + builder.collection);
}
replicas[i] = findReplicas(builder, shardsParam, clusterState, coll.getSlice(sliceOrUrl));
} else {
// this has urls
this.replicas[i] = StrUtils.splitSmart(sliceOrUrl, "|", true);
Expand Down Expand Up @@ -189,7 +190,12 @@ private void addSlices(
String collectionName,
String shardKeys,
boolean multiCollection) {
DocCollection coll = state.getCollection(collectionName);
DocCollection coll = state.getCollectionOrNull(collectionName, true);
if (coll == null) {
throw new SolrException(
SolrException.ErrorCode.BAD_REQUEST,
"Could not find collection to add slices: " + collectionName);
}
Collection<Slice> slices = coll.getRouter().getSearchSlices(shardKeys, params, coll);
ClientUtils.addSlices(target, collectionName, slices, multiCollection);
}
Expand Down
Loading