Solr
  1. Solr
  2. SOLR-8548

CorePropertiesLocator does NOT follow symlinks anymore

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.4
    • Fix Version/s: 5.5
    • Component/s: None
    • Labels:
      None
    • Flags:
      Patch, Important

      Description

      Looks like CorePropertiesLocator was switched over to use the new java.nio stuff... and the simplified version of the walkFileTree method does NOT follow symlinks by default. This is a critical feature that needs to be supported for anyone who has their solr core(s) defined elsewhere, and set up their solr home directory to point to those cores via symlinks. It's important to realize that this is the behavior that has always existed pre-5.4.0 by the nature of using the java.io package to listFiles.

      I'm attaching a PATCH with the appropriate fix.

      1. SOLR-8548.patch
        2 kB
        Aaron LaBella

        Activity

        Hide
        Aaron LaBella added a comment -

        patch to fix issue, please accept asap.

        Show
        Aaron LaBella added a comment - patch to fix issue, please accept asap.
        Hide
        Alan Woodward added a comment -

        ack, thanks for picking this up Aaron.

        Show
        Alan Woodward added a comment - ack, thanks for picking this up Aaron.
        Hide
        Alan Woodward added a comment -

        Is there any reason to set maxDepth to 2? It was Integer.MAX_VALUE before.

        Show
        Alan Woodward added a comment - Is there any reason to set maxDepth to 2? It was Integer.MAX_VALUE before.
        Hide
        Aaron LaBella added a comment -

        Alan, no particular reason other than I think it's silly to have the code check an unlimited number of directories/depth for the core.properties file. I think 2 or 3 at most would be a reasonable limit, not sure why anyone would want to bury their solr cores anymore beyond that. Feel free to change that particular setting to whatever you feel is right.

        Thanks.

        Show
        Aaron LaBella added a comment - Alan, no particular reason other than I think it's silly to have the code check an unlimited number of directories/depth for the core.properties file. I think 2 or 3 at most would be a reasonable limit, not sure why anyone would want to bury their solr cores anymore beyond that. Feel free to change that particular setting to whatever you feel is right. Thanks.
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-8548: Core Discovery was not following symlinks

        Show
        ASF subversion and git services added a comment - Commit 1725196 from Alan Woodward in branch 'dev/trunk' [ https://svn.apache.org/r1725196 ] SOLR-8548 : Core Discovery was not following symlinks
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-8548: Core Discovery was not following symlinks

        Show
        ASF subversion and git services added a comment - Commit 1725203 from Alan Woodward in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1725203 ] SOLR-8548 : Core Discovery was not following symlinks
        Hide
        Alan Woodward added a comment -

        Thanks Aaron. I set the search depth to 256, which seemed like a reasonable compromise.

        Unfortunately I think this is probably a bit late for the 5.4.1 release (unless there's another respin), but if there's a 5.4.2 then I'll make sure it gets included.

        Show
        Alan Woodward added a comment - Thanks Aaron. I set the search depth to 256, which seemed like a reasonable compromise. Unfortunately I think this is probably a bit late for the 5.4.1 release (unless there's another respin), but if there's a 5.4.2 then I'll make sure it gets included.
        Hide
        Shawn Heisey added a comment -

        We could bikeshed about the default depth limit forever.

        I think the default depth limit for software in Linux is 9. 256 seems rather high. The number I thought of was 16. Ultimately it's not up to me, as I'm not the one working on it, but there's my two cents.

        Show
        Shawn Heisey added a comment - We could bikeshed about the default depth limit forever. I think the default depth limit for software in Linux is 9. 256 seems rather high. The number I thought of was 16. Ultimately it's not up to me, as I'm not the one working on it, but there's my two cents.

          People

          • Assignee:
            Alan Woodward
            Reporter:
            Aaron LaBella
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development