Return-Path: X-Original-To: apmail-jackrabbit-oak-commits-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 92838108C6 for ; Wed, 12 Jun 2013 08:24:48 +0000 (UTC) Received: (qmail 59655 invoked by uid 500); 12 Jun 2013 08:24:41 -0000 Delivered-To: apmail-jackrabbit-oak-commits-archive@jackrabbit.apache.org Received: (qmail 59625 invoked by uid 500); 12 Jun 2013 08:24:39 -0000 Mailing-List: contact oak-commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-commits@jackrabbit.apache.org Received: (qmail 59609 invoked by uid 99); 12 Jun 2013 08:24:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jun 2013 08:24:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jun 2013 08:24:37 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1E76923888E4; Wed, 12 Jun 2013 08:24:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1492108 - in /jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene: LuceneIndexConstants.java LuceneIndexEditor.java Date: Wed, 12 Jun 2013 08:24:17 -0000 To: oak-commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130612082418.1E76923888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jukka Date: Wed Jun 12 08:24:17 2013 New Revision: 1492108 URL: http://svn.apache.org/r1492108 Log: OAK-860: Streamline the IndexEditor The Lucene indexer setup should already guarantee that there's only one active writer at any given time, so there should be no need for locking Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexConstants.java jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexConstants.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexConstants.java?rev=1492108&r1=1492107&r2=1492108&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexConstants.java (original) +++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexConstants.java Wed Jun 12 08:24:17 2013 @@ -47,21 +47,4 @@ public interface LuceneIndexConstants { String INDEX_PATH = "index"; - /** - * Lucene writer timeout write lock setting - */ - int TO_WRITE_LOCK_MS = 50; - - /** - * Controls how many retries should happen when there is a writer lock - * timeout - */ - int TO_MAX_RETRIES = 3; - - /** - * Controls how much sleep (ms) should happen when there is a writer lock - * timeout - */ - int TO_SLEEP_MS = 30; - } Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java?rev=1492108&r1=1492107&r2=1492108&view=diff ============================================================================== --- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java (original) +++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java Wed Jun 12 08:24:17 2013 @@ -26,9 +26,9 @@ import static org.apache.jackrabbit.oak. import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.INCLUDE_PROPERTY_TYPES; import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.INDEX_DATA_CHILD_NAME; import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.PERSISTENCE_PATH; -import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.TO_WRITE_LOCK_MS; import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.VERSION; import static org.apache.jackrabbit.oak.plugins.index.lucene.TermFactory.newPathTerm; +import static org.apache.lucene.store.NoLockFactory.getNoLockFactory; import java.io.File; import java.io.IOException; @@ -88,7 +88,6 @@ public class LuceneIndexEditor implement try { IndexWriterConfig config = new IndexWriterConfig(VERSION, ANALYZER); config.setMergeScheduler(new SerialMergeScheduler()); - config.setWriteLockTimeout(TO_WRITE_LOCK_MS); return config; } finally { thread.setContextClassLoader(loader); @@ -105,7 +104,14 @@ public class LuceneIndexEditor implement try { File file = new File(path); file.mkdirs(); - return FSDirectory.open(file); // TODO: close() is never called + // TODO: close() is never called + // TODO: no locking used + // --> using the FS backend for the index is in any case + // troublesome in clustering scenarios and for backup + // etc. so instead of fixing these issues we'd better + // work on making the in-content index work without + // problems (or look at the Solr indexer as alternative) + return FSDirectory.open(file, getNoLockFactory()); } catch (IOException e) { throw new CommitFailedException( "Lucene", 1, "Failed to open the index in " + path, e);