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

The "rename" core admin action does not persist the new name to solr.xml.

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.2, 4.0-ALPHA
    • multicore
    • None

    Description

      The core name during the persistence process is drawn from the core descriptor rather than the corecontainer, and the result is that renames are not persistent. It would be straightforward to change this by using the same style of manipulation of core name as used in the swap admin action.

      It would also be useful to change the access privileges of the name property of a CoreDescriptor so that admin handler implementations can manipulate core names directly.

      Attachments

        1. p
          0.6 kB
          Rasmus Hahn
        2. SOLR-2333.patch
          2 kB
          Mark Miller

        Activity

          rassahah Rasmus Hahn added a comment -

          Here is a patch that fixes the rename in the style of the swap-action.
          Patch is for the 3-1 branch
          (https://svn.apache.org/repos/asf/lucene/dev/branches/lucene_solr_3_1)

          Index: solr/src/java/org/apache/solr/core/CoreContainer.java
          ===================================================================
          — solr/src/java/org/apache/solr/core/CoreContainer.java
          (revision 1094545)
          +++ solr/src/java/org/apache/solr/core/CoreContainer.java (working copy)
          @@ -381,7 +381,12 @@
          SolrCore old = null;
          synchronized (cores)

          { old = cores.put(name, core); + /* + * set both the name of the descriptor and the name of the + * core, since the descriptors name is used for persisting. + */ core.setName(name); + core.getCoreDescriptor ().name = name; }
          rassahah Rasmus Hahn added a comment - Here is a patch that fixes the rename in the style of the swap-action. Patch is for the 3-1 branch ( https://svn.apache.org/repos/asf/lucene/dev/branches/lucene_solr_3_1 ) Index: solr/src/java/org/apache/solr/core/CoreContainer.java =================================================================== — solr/src/java/org/apache/solr/core/CoreContainer.java (revision 1094545) +++ solr/src/java/org/apache/solr/core/CoreContainer.java (working copy) @@ -381,7 +381,12 @@ SolrCore old = null; synchronized (cores) { old = cores.put(name, core); + /* + * set both the name of the descriptor and the name of the + * core, since the descriptors name is used for persisting. + */ core.setName(name); + core.getCoreDescriptor ().name = name; }
          rassahah Rasmus Hahn added a comment -

          patch as a file, since the inline copy seems to be messed up.

          rassahah Rasmus Hahn added a comment - patch as a file, since the inline copy seems to be messed up.
          janhoy Jan Høydahl added a comment -

          Rasmus, please read the full Wiki page on how to contribute http://wiki.apache.org/solr/HowToContribute
          You will find this sentence:

          Note the SOLR-NNN.patch patch file name. Please use this naming pattern when creating patches for uploading to JIRA. Once you create a new JIRA issue, note its name and use that name when naming your patch file. For example, if you are creating a patch for a JIRA issue named SOLR-123, then name your patch filename SOLR-123.patch. If you are creating a new version of an existing patch, use the existing patch's file name. JIRA will automatically "gray out" the old patch and clearly mark your newly uploaded patch as the latest.

          Please delete the "p" patch and upload it again with proper name.

          janhoy Jan Høydahl added a comment - Rasmus, please read the full Wiki page on how to contribute http://wiki.apache.org/solr/HowToContribute You will find this sentence: Note the SOLR-NNN.patch patch file name. Please use this naming pattern when creating patches for uploading to JIRA. Once you create a new JIRA issue, note its name and use that name when naming your patch file. For example, if you are creating a patch for a JIRA issue named SOLR-123 , then name your patch filename SOLR-123 .patch. If you are creating a new version of an existing patch, use the existing patch's file name. JIRA will automatically "gray out" the old patch and clearly mark your newly uploaded patch as the latest. Please delete the "p" patch and upload it again with proper name.
          markrmiller@gmail.com Mark Miller added a comment -

          While looking at this it also became apparent that we want to change how we deal with CoreDescriptor for thread safety - seems we want to make it immutable and make a new one when when we want to change things. This can be done in another issue though.

          markrmiller@gmail.com Mark Miller added a comment - While looking at this it also became apparent that we want to change how we deal with CoreDescriptor for thread safety - seems we want to make it immutable and make a new one when when we want to change things. This can be done in another issue though.
          markrmiller@gmail.com Mark Miller added a comment -

          Thanks guys!

          markrmiller@gmail.com Mark Miller added a comment - Thanks guys!
          rcmuir Robert Muir added a comment -

          Bulk close for 3.2

          rcmuir Robert Muir added a comment - Bulk close for 3.2

          People

            markrmiller@gmail.com Mark Miller
            paulrbrown Paul R. Brown
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: