Solr
  1. Solr
  2. SOLR-6718

relative coreRootDirectory evaluated against CWD, not Solr Home

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.10
    • Fix Version/s: 5.0
    • Component/s: None
    • Labels:
      None

      Description

      as reported by Andreas Hubold on solr-user...

      I'd like to just set it to a subdirectory of solr home (a "cores" directory to
      avoid confusion with configsets and other directories). I tried
      
      <str name="coreRootDirectory">cores</str>
      
      but that's interpreted relative to the current working directory. Other paths 
      such as sharedLib are interpreted relative to Solr Home and I had expected 
      this here too.
      

      This is definitely non-intuitive and we should try to fix it in 5.0 since it will represent a back-compat change for anyone already using a relative path.

      1. SOLR-6718.patch
        10 kB
        Alan Woodward
      2. SOLR-6718.patch
        7 kB
        Alan Woodward
      3. SOLR-6718.patch
        4 kB
        Alan Woodward

        Activity

        Hide
        Erick Erickson added a comment -

        I'm not entirely sure when I'll get to this, hopefully before 5.0. But if anyone else wants to pick it up please feel free!

        Show
        Erick Erickson added a comment - I'm not entirely sure when I'll get to this, hopefully before 5.0. But if anyone else wants to pick it up please feel free!
        Hide
        Alan Woodward added a comment -

        Just bumped into this trying to cut over a bunch of test cases to core discovery for SOLR-6840. Here's a nice simple patch to fix it.

        Show
        Alan Woodward added a comment - Just bumped into this trying to cut over a bunch of test cases to core discovery for SOLR-6840 . Here's a nice simple patch to fix it.
        Hide
        Alan Woodward added a comment -

        Better patch, using NIO2 to resolve paths.

        Show
        Alan Woodward added a comment - Better patch, using NIO2 to resolve paths.
        Hide
        Alan Woodward added a comment -

        Final patch, all tests passing.

        Show
        Alan Woodward added a comment - Final patch, all tests passing.
        Hide
        ASF subversion and git services added a comment -

        Commit 1646660 from Alan Woodward in branch 'dev/trunk'
        [ https://svn.apache.org/r1646660 ]

        SOLR-6718: coreRootDirectory should be resolved against SOLR_HOME

        Show
        ASF subversion and git services added a comment - Commit 1646660 from Alan Woodward in branch 'dev/trunk' [ https://svn.apache.org/r1646660 ] SOLR-6718 : coreRootDirectory should be resolved against SOLR_HOME
        Hide
        ASF subversion and git services added a comment -

        Commit 1646665 from Alan Woodward in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1646665 ]

        SOLR-6718: coreRootDirectory should be resolved against SOLR_HOME

        Show
        ASF subversion and git services added a comment - Commit 1646665 from Alan Woodward in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1646665 ] SOLR-6718 : coreRootDirectory should be resolved against SOLR_HOME
        Hide
        Shawn Heisey added a comment -

        No need to re-open, but I'd like to bring up a point for anyone that finds this issue.

        The coreRootDirectory defaults to the solr home if you don't specify it in solr.xml.

        If you are going to use a coreRootDirectory that's underneath the solr home, you may be able to leave coreRootDirectory out of solr.xml entirely and still get the functionality you want. As long as you don't have core.properties files in any other location under the solr home besides the place you want Solr to search, and there aren't thousands or millions of files/directories, it won't present any problems to have Solr search the entire solr home.

        Show
        Shawn Heisey added a comment - No need to re-open, but I'd like to bring up a point for anyone that finds this issue. The coreRootDirectory defaults to the solr home if you don't specify it in solr.xml. If you are going to use a coreRootDirectory that's underneath the solr home, you may be able to leave coreRootDirectory out of solr.xml entirely and still get the functionality you want. As long as you don't have core.properties files in any other location under the solr home besides the place you want Solr to search, and there aren't thousands or millions of files/directories, it won't present any problems to have Solr search the entire solr home.
        Hide
        Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

          • Assignee:
            Alan Woodward
            Reporter:
            Hoss Man
          • Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development