lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r1698200 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/core/SolrConfig.java core/src/java/org/apache/solr/core/SolrCore.java
Date Thu, 27 Aug 2015 17:35:41 GMT
Author: hossman
Date: Thu Aug 27 17:35:40 2015
New Revision: 1698200

URL: http://svn.apache.org/r1698200
Log:
SOLR-7942: Previously removed unlockOnStartup option (LUCENE-6508) now logs warning if configured,
will be an error in 6.0.  Also improved error msg if an index is locked on startup

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1698200&r1=1698199&r2=1698200&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Thu Aug 27 17:35:40 2015
@@ -214,6 +214,9 @@ Other Changes
 * SOLR-7970: Factor out a SearchGroupsFieldCommandResult class.
   (Christine Poerschke)
 
+* SOLR-7942: Previously removed unlockOnStartup option (LUCENE-6508) now logs warning if
configured,
+  will be an error in 6.0.  Also improved error msg if an index is locked on startup  (hossman)
+
 ==================  5.3.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java?rev=1698200&r1=1698199&r2=1698200&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java Thu Aug 27 17:35:40
2015
@@ -216,7 +216,15 @@ public class SolrConfig extends Config i
             " This config will be removed in future versions.", getNode(indexConfigPrefix
+ "/nrtMode", false) == null,
         true
     );
-
+    assertWarnOrFail("Solr no longer supports forceful unlocking via the 'unlockOnStartup'
option.  "+
+                     "This is no longer neccessary for the default lockType except in situations
where "+
+                     "it would be dangerous and should not be done.  For other lockTypes
and/or "+
+                     "directoryFactory options it may also be dangerous and users must resolve
"+
+                     "problematic locks manually.",
+                     null == getNode(indexConfigPrefix + "/unlockOnStartup", false),
+                     true // 'fail' in trunk
+                     );
+                     
     // Parse indexConfig section, using mainIndex as backup in case old config is used
     indexConfig = new SolrIndexConfig(this, "indexConfig", mainIndexConfig);
 

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java?rev=1698200&r1=1698199&r2=1698200&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrCore.java Thu Aug 27 17:35:40
2015
@@ -530,17 +530,17 @@ public final class SolrCore implements S
     initIndexReaderFactory();
 
     if (indexExists && firstTime && !reload) {
-
-      Directory dir = directoryFactory.get(indexDir, DirContext.DEFAULT,
-          getSolrConfig().indexConfig.lockType);
+      final String lockType = getSolrConfig().indexConfig.lockType;
+      Directory dir = directoryFactory.get(indexDir, DirContext.DEFAULT, lockType);
       try {
         if (IndexWriter.isLocked(dir)) {
-          log.error(logid
-              + "Solr index directory '{}' is locked.  Throwing exception.",
-              indexDir);
-          throw new LockObtainFailedException(
-              "Index locked for write for core '" + name +
-              "'. Solr now longer supports forceful unlocking via 'unlockOnStartup'. Please
verify locks manually!");
+          log.error(logid + "Solr index directory '{}' is locked (lockType={}).  Throwing
exception.",
+                    indexDir, lockType);
+          throw new LockObtainFailedException
+            ("Index dir '" + indexDir + "' of core '" + name + "' is already locked. " +
+             "The most likely cause is another Solr server (or another solr core in this
server) " +
+             "also configured to use this directory; other possible causes may be specific
to lockType: " +
+             lockType);
         }
       } finally {
         directoryFactory.release(dir);



Mime
View raw message