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.
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
{ 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; }===================================================================
— 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)