You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2015/08/27 20:12:11 UTC
svn commit: r1698203 - in /lucene/dev/branches/branch_5x: ./ solr/
solr/CHANGES.txt solr/core/
solr/core/src/java/org/apache/solr/core/SolrConfig.java
solr/core/src/java/org/apache/solr/core/SolrCore.java
Author: hossman
Date: Thu Aug 27 18:12:10 2015
New Revision: 1698203
URL: http://svn.apache.org/r1698203
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 (merge r1698200)
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_5x/solr/core/ (props changed)
lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrConfig.java
lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrCore.java
Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1698203&r1=1698202&r2=1698203&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Thu Aug 27 18:12:10 2015
@@ -134,6 +134,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/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrConfig.java?rev=1698203&r1=1698202&r2=1698203&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrConfig.java Thu Aug 27 18:12:10 2015
@@ -230,7 +230,15 @@ public class SolrConfig extends Config i
" This config will be removed in future versions.", getNode(indexConfigPrefix + "/nrtMode", false) == null,
false
);
-
+ 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),
+ false // warn in 5x
+ );
+
// Parse indexConfig section, using mainIndex as backup in case old config is used
indexConfig = new SolrIndexConfig(this, "indexConfig", mainIndexConfig);
Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrCore.java?rev=1698203&r1=1698202&r2=1698203&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/core/SolrCore.java Thu Aug 27 18:12:10 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);