0

Such change is advertised by Solr creators as something that reduces dependency on ZK and is advised to be done to migrate to solr9: https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html

We are using solr 8.11.1 and wanted to use solr urls instead of zk. After such change - http calls increased by 40-60% due to additional calls to get clusterState - that was previously retrieved from ZK

In fact, calls to getClusterState that are done internally by the httpclient are heavier in terms of performance after doing such a change as there are additional HTTP calls.

Code in question from CloudHttp2SolrClient class:

if (builder.zkHosts != null) {
        this.stateProvider = new ZkClientClusterStateProvider(builder.zkHosts, builder.zkChroot);
      } else if (builder.solrUrls != null && !builder.solrUrls.isEmpty()) {
        try {
          this.stateProvider = new Http2ClusterStateProvider(builder.solrUrls, builder.httpClient);
        } catch (Exception e) {
          throw new RuntimeException("Couldn't initialize a HttpClusterStateProvider (is/are the "
              + "Solr server(s), "  + builder.solrUrls + ", down?)", e);
        }
      }

Had anyone configured this client in a way that performance is not decreased after such a change? Maybe there is a way to not ask for cluster state so many times?

0 Answers0