Solr
  1. Solr
  2. SOLR-3984

Solr Admin Unload with deleteInstanceDir=true fails unless the path is absolute.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0-ALPHA, 4.0-BETA, 4.0
    • Fix Version/s: 4.1, Trunk
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      Call URL :
      http://localhost:8983/solr/admin/cores?action=UNLOAD&deleteInstanceDir=true&core=mycollection1&qt=/admin/cores

      Check the disk path:
      folder: /apache-solr-4.0.0/example3/solr/mycollection1 still exist, but caller response is success.

      1. patch.txt
        1 kB
        Raintung Li
      2. SOLR-3984.patch
        4 kB
        Erick Erickson

        Activity

        Hide
        Raintung Li added a comment -

        Fix the bug patch

        Show
        Raintung Li added a comment - Fix the bug patch
        Hide
        Erick Erickson added a comment -

        Raintung is correct. In fact, deleteInstanceDir seems to be completely broken unless you specify an absolute dir.

        Here's a reworked patch because it seems like the trap here (CoreContainer.getInstanceDir()) is just laying in wait for the unwary. I've added a new method getRawInstanceDir and refactored the uses of getInstanceDir to use the right one. I wouldn't dare return the new getInstanceDir to, say, the snapshooter code, and the code that writes solr.xml back out would also be broken if it used the (new) getInstanceDir().

        If there are no objections, I'll commit this tomorrow.

        Thanks Raintung! Your patch provided me a much easier time tackling this!

        Show
        Erick Erickson added a comment - Raintung is correct. In fact, deleteInstanceDir seems to be completely broken unless you specify an absolute dir. Here's a reworked patch because it seems like the trap here (CoreContainer.getInstanceDir()) is just laying in wait for the unwary. I've added a new method getRawInstanceDir and refactored the uses of getInstanceDir to use the right one. I wouldn't dare return the new getInstanceDir to, say, the snapshooter code, and the code that writes solr.xml back out would also be broken if it used the (new) getInstanceDir(). If there are no objections, I'll commit this tomorrow. Thanks Raintung! Your patch provided me a much easier time tackling this!
        Hide
        Erick Erickson added a comment -

        r: 1402254 (trunk)
        r: 1402282 (4x branch)

        Show
        Erick Erickson added a comment - r: 1402254 (trunk) r: 1402282 (4x branch)
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Erick Erickson
        http://svn.apache.org/viewvc?view=revision&revision=1402282

        Fix for SOLR-3984, Solr Admin Unload with deleteInstanceDir=true fails unless the path is absolute

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Erick Erickson http://svn.apache.org/viewvc?view=revision&revision=1402282 Fix for SOLR-3984 , Solr Admin Unload with deleteInstanceDir=true fails unless the path is absolute

          People

          • Assignee:
            Erick Erickson
            Reporter:
            Raintung Li
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 168h
              168h
              Remaining:
              Remaining Estimate - 168h
              168h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development