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 723691884E for ; Wed, 29 Jul 2015 12:44:08 +0000 (UTC) Received: (qmail 92458 invoked by uid 500); 29 Jul 2015 12:44:08 -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 92449 invoked by uid 99); 29 Jul 2015 12:44:08 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jul 2015 12:44:08 +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 E5CA9AC077F for ; Wed, 29 Jul 2015 12:44:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1693251 - in /lucene/dev/trunk/solr: CHANGES.txt solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java Date: Wed, 29 Jul 2015 12:44:07 -0000 To: commits@lucene.apache.org From: shalin@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150729124407.E5CA9AC077F@hades.apache.org> Author: shalin Date: Wed Jul 29 12:44:07 2015 New Revision: 1693251 URL: http://svn.apache.org/r1693251 Log: SOLR-7840: ZkStateReader.updateClusterState fetches watched collections twice from ZK Modified: lucene/dev/trunk/solr/CHANGES.txt lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java Modified: lucene/dev/trunk/solr/CHANGES.txt URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1693251&r1=1693250&r2=1693251&view=diff ============================================================================== --- lucene/dev/trunk/solr/CHANGES.txt (original) +++ lucene/dev/trunk/solr/CHANGES.txt Wed Jul 29 12:44:07 2015 @@ -272,7 +272,8 @@ Optimizations For Example: The facet request {type:terms, field:field1, facet:{x:"unique(field2)"}} saw a 7x improvement when field1 and 1M unique terms and field2 had 1000 unique terms. (yonik) - + +* SOLR-7840: ZkStateReader.updateClusterState fetches watched collections twice from ZK. (shalin) Other Changes ---------------------- Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java?rev=1693251&r1=1693250&r2=1693251&view=diff ============================================================================== --- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java (original) +++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java Wed Jul 29 12:44:07 2015 @@ -428,7 +428,7 @@ public class ZkStateReader implements Cl if (watchedCollections.contains(s)) { DocCollection live = getCollectionLive(this, s); if (live != null) { - watchedCollectionStates.put(s, live); + updateWatchedCollection(live); // if it is a watched collection, add too result.put(s, new ClusterState.CollectionRef(live)); } @@ -506,15 +506,6 @@ public class ZkStateReader implements Cl } this.clusterState = clusterState; } - synchronized (ZkStateReader.this) { - for (String watchedCollection : watchedCollections) { - DocCollection live = getCollectionLive(this, watchedCollection); - if (live != null) { - updateWatchedCollection(live); - } - } - } - } else { if (clusterStateUpdateScheduled) { log.debug("Cloud state update for ZooKeeper already scheduled"); @@ -946,9 +937,7 @@ public class ZkStateReader implements Cl private void updateWatchedCollection(DocCollection newState) { watchedCollectionStates.put(newState.getName(), newState); - log.info("Updating data for {} to ver {} ", newState.getName(), - newState.getZNodeVersion()); - + log.info("Updating data for {} to ver {} ", newState.getName(), newState.getZNodeVersion()); this.clusterState = clusterState.copyWith(newState.getName(), newState); }