Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15587

Replicas end up with base_url as http on client side even if cluster state says https when using the HttpClusterStateProvider

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 8.8, 8.8.1, 8.8.2, 8.9, 8.10, 8.11, 8.10.1, 8.11.1
    • 9.0, 8.11.2
    • SolrJ
    • None

    Description

      Assuming you have a SolrCloud cluster with TLS enabled and are instantiating a CloudSolrClient using a Solr URL vs. ZK connection string, then the changes made for SOLR-12182 in 8.8.0 have introduced a bug where the base_url for replicas in the ClusterState returned by the HttpClusterStateProvider have url scheme http instead of https when the global singleton UrlScheme.INSTANCE is not set to https. This does NOT impact ClusterState returned by the ZkClusterStateProvider because the ZkStateReader calls UrlScheme.INSTANCE.setUrlScheme("https").

      The easiest work-around for now is for client applications to call:

      UrlScheme.INSTANCE.setUrlScheme(UrlScheme.HTTPS);
      

      Before creating SolrJ client objects such as CloudSolrClient.

      I think the proper fix would be to call putIfAbsent in Replica ctor:

          propMap.putIfAbsent(BASE_URL_PROP, UrlScheme.INSTANCE.getBaseUrlForNodeName(this.nodeName));
      

      but need to run all existing tests and create a new unit test for this situation.

      Attachments

        Issue Links

          Activity

            People

              thelabdude Timothy Potter
              thelabdude Timothy Potter
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h