Return-Path: X-Original-To: apmail-lucene-commits-archive@www.apache.org Delivered-To: apmail-lucene-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D8172188D2 for ; Wed, 27 May 2015 13:33:28 +0000 (UTC) Received: (qmail 5492 invoked by uid 500); 27 May 2015 13:33:28 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 5483 invoked by uid 99); 27 May 2015 13:33:28 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2015 13:33:28 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 7C879AC06F9 for ; Wed, 27 May 2015 13:33:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1682019 - in /lucene/dev/branches/lucene_solr_5_2: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/core/SolrCore.java Date: Wed, 27 May 2015 13:33:28 -0000 To: commits@lucene.apache.org From: thelabdude@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150527133328.7C879AC06F9@hades.apache.org> Author: thelabdude Date: Wed May 27 13:33:28 2015 New Revision: 1682019 URL: http://svn.apache.org/r1682019 Log: SOLR-7587: Move the call to seed version buckets to before buffering updates during core construction Modified: lucene/dev/branches/lucene_solr_5_2/ (props changed) lucene/dev/branches/lucene_solr_5_2/solr/ (props changed) lucene/dev/branches/lucene_solr_5_2/solr/CHANGES.txt (contents, props changed) lucene/dev/branches/lucene_solr_5_2/solr/core/ (props changed) lucene/dev/branches/lucene_solr_5_2/solr/core/src/java/org/apache/solr/core/SolrCore.java Modified: lucene/dev/branches/lucene_solr_5_2/solr/CHANGES.txt URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_2/solr/CHANGES.txt?rev=1682019&r1=1682018&r2=1682019&view=diff ============================================================================== --- lucene/dev/branches/lucene_solr_5_2/solr/CHANGES.txt (original) +++ lucene/dev/branches/lucene_solr_5_2/solr/CHANGES.txt Wed May 27 13:33:28 2015 @@ -266,6 +266,11 @@ Bug Fixes * SOLR-7585: Fix NoSuchElementException in LFUCache resulting from heavy writes making concurrent put() calls. (Maciej Zasada via Shawn Heisey) +* SOLR-7587: Seeding bucket versions from index when the firstSearcher event fires has a race condition + that leads to an infinite wait on VersionInfo's ReentrantReadWriteLock because the read-lock acquired + during a commit cannot be upgraded to a write-lock needed to block updates; solution is to move the + call out of the firstSearcher event path and into the SolrCore constructor. (Timothy Potter) + Optimizations ---------------------- Modified: lucene/dev/branches/lucene_solr_5_2/solr/core/src/java/org/apache/solr/core/SolrCore.java URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_2/solr/core/src/java/org/apache/solr/core/SolrCore.java?rev=1682019&r1=1682018&r2=1682019&view=diff ============================================================================== --- lucene/dev/branches/lucene_solr_5_2/solr/core/src/java/org/apache/solr/core/SolrCore.java (original) +++ lucene/dev/branches/lucene_solr_5_2/solr/core/src/java/org/apache/solr/core/SolrCore.java Wed May 27 13:33:28 2015 @@ -841,6 +841,9 @@ public final class SolrCore implements S } } + // seed version buckets with max from index during core initialization ... requires a searcher! + seedVersionBucketsWithMaxFromIndex(); + bufferUpdatesIfConstructing(coreDescriptor); // For debugging @@ -849,16 +852,20 @@ public final class SolrCore implements S this.ruleExpiryLock = new ReentrantLock(); registerConfListener(); + } - // seed version buckets with max from index during core initialization - if (this.updateHandler != null && this.updateHandler.getUpdateLog() != null) { + private void seedVersionBucketsWithMaxFromIndex() { + UpdateHandler uh = getUpdateHandler(); + if (uh != null && uh.getUpdateLog() != null) { RefCounted newestSearcher = getRealtimeSearcher(); if (newestSearcher != null) { try { - this.updateHandler.getUpdateLog().onFirstSearcher(newestSearcher.get()); + uh.getUpdateLog().onFirstSearcher(newestSearcher.get()); } finally { newestSearcher.decref(); } + } else { + log.warn("No searcher available! Cannot seed version buckets with max from index."); } } }