Skip to content
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

SOLR-15732 : queries to missing collection are slow #2597

Open
wants to merge 3 commits into
base: branch_8x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Bug Fixes

* SOLR-15676: Fix PeerSync failure due to RealTimeGetComponent returning duplicates. (Ramsey Haddad, Christine Poerschke, David Smiley)

* SOLR-15732: queries to missing collection are slow (noble)

Build
---------------------

Expand Down
5 changes: 4 additions & 1 deletion solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,10 @@ protected void extractRemotePath(String collectionName, String origCorename) thr
} 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()) {
//no change. go back
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about the line below, forceUpdateCollection?

}
cores.getZkController().zkStateReader.forceUpdateCollection(collectionName);
action = RETRY;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,12 @@ public boolean update() throws KeeperException, InterruptedException {
log.debug("Checking ZK for most up to date Aliases {}", ALIASES);
// Call sync() first to ensure the subsequent read (getData) is up to date.
zkClient.getSolrZooKeeper().sync(ALIASES, null, null);
Stat stat = new Stat();
Stat stat = zkClient.exists(ALIASES, null, true);
if (stat.getVersion() <= aliases.getZNodeVersion()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. So you've found that it's faster to request only the "Stat" without the data so long as this is the typical path?

//we already have the latest version.
return false;
}
stat = new Stat();
final byte[] data = zkClient.getData(ALIASES, null, stat, true);
return setIfNewer(Aliases.fromJSON(data, stat.getVersion()));
}
Expand Down