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

Invalid path string using ZkConfigManager.copyConfigDir(String fromConfig, String toConfig)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 7.2.1
    • 7.3
    • SolrJ
    • None
    •  

       

    Description

      I've found an issue while using the method ZkConfigManager.copyConfigDir(String fromConfig, String toConfig) from SolrJ 7.2.1.
       
      The error message is:
      Invalid path string "/configs//configs/myconfig" caused by empty node name specified
       
      The problem is the method with two parameters changes the fromConfig and toConfig parameters, adding "/configs/", before calling the overloading method with 3 parameters, that adds "/configs/" again in both parameters. 
      Guess it's a bit confusing to explain, but it's easier when looking at the code. Here's the methods implementations :
       
       

      public void copyConfigDir(String fromConfig, String toConfig) throws IOException {
        copyConfigDir(CONFIGS_ZKNODE + "/" + fromConfig, CONFIGS_ZKNODE + "/" + toConfig, null);
      }
      
      public void copyConfigDir(String fromConfig, String toConfig, Set<String> copiedToZkPaths) throws IOException {
        copyConfigDirFromZk(CONFIGS_ZKNODE + "/" + fromConfig, CONFIGS_ZKNODE + "/" + toConfig, copiedToZkPaths);
      }
      

      The solution is just remove the 'CONFIGS_ZKNODE + "/"' in the former method. 

       
      The workaround is calling directly the latter method.

      Attachments

        1. 0001-SOLR-12072.patch
          2 kB
          Alessandro Hoss
        2. SOLR-12072.patch
          2 kB
          Erick Erickson

        Activity

          People

            erickerickson Erick Erickson
            alehoss Alessandro Hoss
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: