SOLR-7955: further optimization to avoid zk lookup

This commit is contained in:
Noble Paul 2017-02-02 18:31:07 +10:30
parent 3e44928f49
commit ff1a9e9235
1 changed files with 4 additions and 1 deletions

View File

@ -341,7 +341,10 @@ public class HttpSolrCall {
}
protected void autoCreateSystemColl(String corename) throws Exception {
if (SYSTEM_COLL.equals(corename) && "POST".equals(req.getMethod()) && !cores.getZkController().getClusterState().hasCollection(SYSTEM_COLL)) {
if (core == null &&
SYSTEM_COLL.equals(corename) &&
"POST".equals(req.getMethod()) &&
!cores.getZkController().getClusterState().hasCollection(SYSTEM_COLL)) {
log.info("Going to auto-create .system collection");
SolrQueryResponse rsp = new SolrQueryResponse();
String repFactor = String.valueOf(Math.min(3, cores.getZkController().getClusterState().getLiveNodes().size()));