Skip to content

Apache Lucene open-source search software

SOLR-5279: Implicit properties don't seem to exist on core RELOAD

Steven Rowe52ca9611002a
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e8cf1ce63aa..369b9493e3f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -84,6 +84,9 @@ Bug Fixes
* SOLR-5281: IndexSchema log message was printing '[null]' instead of
'[<core name>]' (Jun Ohtani via Steve Rowe)
+
+* SOLR-5279: Implicit properties don't seem to exist on core RELOAD
+ (elyograg, hossman, Steve Rowe)
Security
----------------------
diff --git a/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java b/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java
index 71e1a7c8926..7a4ec673694 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreDescriptor.java
@@ -56,6 +56,7 @@ public class CoreDescriptor {
public static final String CORE_LOADONSTARTUP = "loadOnStartup";
public static final String CORE_TRANSIENT = "transient";
public static final String CORE_NODE_NAME = "coreNodeName";
+ public static final String SOLR_CORE_PROP_PREFIX = "solr.core.";
public static final String DEFAULT_EXTERNAL_PROPERTIES_FILE = "conf" + File.separator + "solrcore.properties";
@@ -214,7 +215,7 @@ public class CoreDescriptor {
for (String propName : coreProperties.stringPropertyNames()) {
String propValue = coreProperties.getProperty(propName);
if (!isUserDefinedProperty(propName))
- propName = "solr.core." + propName;
+ propName = SOLR_CORE_PROP_PREFIX + propName;
substitutableProperties.setProperty(propName, propValue);
}
}
@@ -261,12 +262,14 @@ public class CoreDescriptor {
*/
public CoreDescriptor(String coreName, CoreDescriptor other) {
this.coreContainer = other.coreContainer;
+ this.cloudDesc = other.cloudDesc;
this.originalExtraProperties.putAll(other.originalExtraProperties);
this.originalCoreProperties.putAll(other.originalCoreProperties);
this.coreProperties.putAll(other.coreProperties);
+ this.substitutableProperties.putAll(other.substitutableProperties);
this.coreProperties.setProperty(CORE_NAME, coreName);
this.originalCoreProperties.setProperty(CORE_NAME, coreName);
- this.cloudDesc = other.cloudDesc;
+ this.substitutableProperties.setProperty(SOLR_CORE_PROP_PREFIX + CORE_NAME, coreName);
}
public String getPropertiesName() {
diff --git a/solr/core/src/test/org/apache/solr/core/TestImplicitCoreProperties.java b/solr/core/src/test/org/apache/solr/core/TestImplicitCoreProperties.java
index e958f3336ad..4836195061d 100644
--- a/solr/core/src/test/org/apache/solr/core/TestImplicitCoreProperties.java
+++ b/solr/core/src/test/org/apache/solr/core/TestImplicitCoreProperties.java
@@ -38,6 +38,8 @@ public class TestImplicitCoreProperties extends SolrTestCaseJ4 {
, "//str[@name='dummy4'][.='schema.xml']"
, "//str[@name='dummy5'][.='false']"
);
+ // Test for SOLR-5279 - make sure properties are there on core reload
+ cc.reload("collection1");
}
finally {
cc.shutdown();