Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-6897: Throw fatal error if nrtMode is present in solrconfig on 6.0. Added note to upgrade section.

Shalin Shekhar Mangar75f6dd52e4fa
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 44543e34b85..4e4d5260d70 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -40,6 +40,9 @@ Upgrading from Solr 5.x
* The deprecated SolrServer and subclasses have been removed, use SolrClient
instead.
+* The deprecated <nrtMode> configuration in solrconfig.xml has been removed.
+ Please remove it from solrconfig.xml.
+
Detailed Change List
----------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SolrConfig.java b/solr/core/src/java/org/apache/solr/core/SolrConfig.java
index 606554d7b64..b63e1f9e59b 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrConfig.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrConfig.java
@@ -195,7 +195,7 @@ public class SolrConfig extends Config implements MapSerializable{
}
assertWarnOrFail("The <nrtMode> config has been discontinued and NRT mode is always used by Solr." +
" This config will be removed in future versions.", getNode(indexConfigPrefix + "/nrtMode", false) == null,
- false
+ true
);
// Parse indexConfig section, using mainIndex as backup in case old config is used
diff --git a/solr/core/src/test-files/solr/collection1/conf/bad-solrconfig-nrtmode.xml b/solr/core/src/test-files/solr/collection1/conf/bad-solrconfig-nrtmode.xml
new file mode 100644
index 00000000000..879c1ad428f
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/bad-solrconfig-nrtmode.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" ?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<config>
+
+ <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+ <directoryFactory name="DirectoryFactory" class="NRTCachingDirectoryFactory"/>
+
+ <!-- BEGIN: BAD -->
+ <indexConfig>
+ <nrtMode>false</nrtMode>
+ </indexConfig>
+ <!-- END: BAD -->
+
+
+</config>
diff --git a/solr/core/src/test/org/apache/solr/core/TestBadConfig.java b/solr/core/src/test/org/apache/solr/core/TestBadConfig.java
index 621dba6e49a..07d2e69c80e 100644
--- a/solr/core/src/test/org/apache/solr/core/TestBadConfig.java
+++ b/solr/core/src/test/org/apache/solr/core/TestBadConfig.java
@@ -27,6 +27,10 @@ public class TestBadConfig extends AbstractBadConfigTestBase {
assertConfigs("bad_solrconfig.xml","schema.xml","unset.sys.property");
}
+ public void testNRTModeProperty() throws Exception {
+ assertConfigs("bad-solrconfig-nrtmode.xml","schema.xml", "nrtMode");
+ }
+
public void testMultipleDirectoryFactories() throws Exception {
assertConfigs("bad-solrconfig-multiple-dirfactory.xml", "schema12.xml",
"directoryFactory");