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

SolrCore clean-up logic uses incorrect path to delete dataDir on failure to create a core

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.5.2
    • Fix Version/s: 7.0, 6.7
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      When a core fails to be created for some reason (errant schema or solrconfig etc.), SolrCore.deleteUnloadedCore() is called from unload() in CoreContainer in order to clean-up the possibly left-over dataDir and instanceDir. The problem is that the CoreDescriptor passed to SolrCore.deleteUnloadedCore() will have its value for dataDir set to just "data/" unless an explicit dataDir was specified by the user in the request to create the core, leading to an attempt to delete simply "data/", which presumably resolves to a non-existent directory under Solr's home directory or some such.

      https://github.com/apache/lucene-solr/blob/branch_5_5/solr/core/src/java/org/apache/solr/core/CoreContainer.java#L974

      https://github.com/apache/lucene-solr/blob/branch_5_5/solr/core/src/java/org/apache/solr/core/SolrCore.java#L2537

      1. SOLR-9433.patch
        4 kB
        Shalin Shekhar Mangar

        Activity

        Hide
        shalinmangar Shalin Shekhar Mangar added a comment -

        Patch with a fix and test. The data directory needed to be resolved against the coreRootDirectory.

        Show
        shalinmangar Shalin Shekhar Mangar added a comment - Patch with a fix and test. The data directory needed to be resolved against the coreRootDirectory.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit da7ccd3eefc92943ac0cea5103c84530f77d67a4 in lucene-solr's branch refs/heads/branch_6x from Shalin Shekhar Mangar
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=da7ccd3 ]

        SOLR-9433: SolrCore clean-up logic uses incorrect path to delete dataDir on failure to create a core

        (cherry picked from commit 5120816)

        Show
        jira-bot ASF subversion and git services added a comment - Commit da7ccd3eefc92943ac0cea5103c84530f77d67a4 in lucene-solr's branch refs/heads/branch_6x from Shalin Shekhar Mangar [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=da7ccd3 ] SOLR-9433 : SolrCore clean-up logic uses incorrect path to delete dataDir on failure to create a core (cherry picked from commit 5120816)
        Hide
        shalinmangar Shalin Shekhar Mangar added a comment -

        This is the corresponding commit on master: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/51208163

        I wrote "OLR-9433" instead of SOLR-9433 so the commit bot did not post the message to this issue.

        Show
        shalinmangar Shalin Shekhar Mangar added a comment - This is the corresponding commit on master: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/51208163 I wrote "OLR-9433" instead of SOLR-9433 so the commit bot did not post the message to this issue.
        Hide
        shalinmangar Shalin Shekhar Mangar added a comment -

        Thanks Evan!

        Show
        shalinmangar Shalin Shekhar Mangar added a comment - Thanks Evan!
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit eded69ba8ff5df5dbeb10c9996a1b591bd9ec243 in lucene-solr's branch refs/heads/master from Shalin Shekhar Mangar
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=eded69b ]

        SOLR-9433: Ignore testDeleteInstanceDirAfterCreateFailure on windows

        Show
        jira-bot ASF subversion and git services added a comment - Commit eded69ba8ff5df5dbeb10c9996a1b591bd9ec243 in lucene-solr's branch refs/heads/master from Shalin Shekhar Mangar [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=eded69b ] SOLR-9433 : Ignore testDeleteInstanceDirAfterCreateFailure on windows
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 2badb2b4d8d2900c5323870e24f3f2023c200b33 in lucene-solr's branch refs/heads/branch_6x from Shalin Shekhar Mangar
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2badb2b ]

        SOLR-9433: Ignore testDeleteInstanceDirAfterCreateFailure on windows

        (cherry picked from commit eded69b)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 2badb2b4d8d2900c5323870e24f3f2023c200b33 in lucene-solr's branch refs/heads/branch_6x from Shalin Shekhar Mangar [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2badb2b ] SOLR-9433 : Ignore testDeleteInstanceDirAfterCreateFailure on windows (cherry picked from commit eded69b)
        Hide
        romseygeek Alan Woodward added a comment -

        Hey Shalin, I think the failing test here reveals a real bug - we're leaking a file descriptor on a transaction log when the core reloads, which is why Windows refuses to delete it.

        Show
        romseygeek Alan Woodward added a comment - Hey Shalin, I think the failing test here reveals a real bug - we're leaking a file descriptor on a transaction log when the core reloads, which is why Windows refuses to delete it.
        Hide
        shalinmangar Shalin Shekhar Mangar added a comment -

        Thanks Alan, I'll take a look.

        Show
        shalinmangar Shalin Shekhar Mangar added a comment - Thanks Alan, I'll take a look.
        Hide
        ichattopadhyaya Ishan Chattopadhyaya added a comment -

        Moving to 6.5, since 6.4 has already been released.

        Show
        ichattopadhyaya Ishan Chattopadhyaya added a comment - Moving to 6.5, since 6.4 has already been released.

          People

          • Assignee:
            shalinmangar Shalin Shekhar Mangar
            Reporter:
            evansayer Evan Sayer
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:

              Development