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

Creating a core.properties fails if the parent of core.properties is a symlinked dierctory

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.6.1, 7.0, master (8.0)
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      Well, it doesn't actually fail until you try to restart the Solr instance. The root is that creating core.properties fails.

      This is due to SOLR-8260. CorePropertiesLocator.writePropertiesFile changed from:
      propfile.getParentFile().mkdirs();
      to
      Files.createDirectories(propfile.getParent());

      The former (apparently) thinks it's OK if a symlink points to a directory, but the latter throws an exception.

      So the behavior here is that the call appears to succeed, the replica is created and is functional. Until you restart the instance when it's not discovered.

      I hacked in a simple test to see if the parent existed already and skip the call to createDirectories if so and ADDREPLICA works just fine. Restarting Solr finds the replica.

      The test "for real" would probably have to be better than this as we probably really want to keep from overwriting an existing replica and the like, didn't check whether that's already accounted for though.

      There's another issue here that failing to write the properties file should fail the ADDREPLICA IMO.

      Alan Woodward I'm guessing that this is an unintended side-effect of SOLR-8260 but wanted to check before diving in deeper.

        Attachments

        1. SOLR-10719.patch
          3 kB
          Erick Erickson
        2. SOLR-10719.patch
          3 kB
          Erick Erickson

          Activity

            People

            • Assignee:
              erickerickson Erick Erickson
              Reporter:
              erickerickson Erick Erickson
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: