You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2013/10/10 08:54:37 UTC

svn commit: r1530861 - in /lucene/dev/branches/lucene_solr_4_5: ./ solr/ solr/core/ solr/core/src/java/org/apache/solr/cloud/ solr/core/src/java/org/apache/solr/handler/admin/ solr/core/src/test/org/apache/solr/cloud/ solr/solrj/ solr/solrj/src/java/or...

Author: shalin
Date: Thu Oct 10 06:54:36 2013
New Revision: 1530861

URL: http://svn.apache.org/r1530861
Log:
SOLR-4590, SOLR-5295, SOLR-5296, SOLR-5263, SOLR-5297, SOLR-5301, SOLR-5255, SOLR-5305, SOLR-5314: Merging r1526616, r1528433, r1528441, r1528461, r1528488, r1529341, r1529434, r1529503, r1530268 from branch_4x

Modified:
    lucene/dev/branches/lucene_solr_4_5/   (props changed)
    lucene/dev/branches/lucene_solr_4_5/solr/   (props changed)
    lucene/dev/branches/lucene_solr_4_5/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/lucene_solr_4_5/solr/core/   (props changed)
    lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/cloud/Overseer.java
    lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
    lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
    lucene/dev/branches/lucene_solr_4_5/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java
    lucene/dev/branches/lucene_solr_4_5/solr/solrj/   (props changed)
    lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
    lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
    lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
    lucene/dev/branches/lucene_solr_4_5/solr/webapp/   (props changed)
    lucene/dev/branches/lucene_solr_4_5/solr/webapp/web/css/styles/threads.css
    lucene/dev/branches/lucene_solr_4_5/solr/webapp/web/js/scripts/index.js

Modified: lucene/dev/branches/lucene_solr_4_5/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_5/solr/CHANGES.txt?rev=1530861&r1=1530860&r2=1530861&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_5/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_4_5/solr/CHANGES.txt Thu Oct 10 06:54:36 2013
@@ -22,6 +22,44 @@ $Id$
 
 ==================  4.5.1 ==================
 
+Versions of Major Components
+---------------------
+Apache Tika 1.4
+Carrot2 3.8.0
+Velocity 1.7 and Velocity Tools 2.0
+Apache UIMA 2.3.1
+Apache ZooKeeper 3.4.5
+
+Detailed Change List
+----------------------
+
+Bug Fixes
+----------------------
+
+* SOLR-4590: Collections API should return a nice error when not in SolrCloud mode.
+  (Anshum Gupta, Mark Miller)
+
+* SOLR-5295: The CREATESHARD collection API creates maxShardsPerNode number of
+  replicas if replicationFactor is not specified. (Brett Hoerner, shalin)
+
+* SOLR-5296: Creating a collection with implicit router adds shard ranges
+  to each shard. (shalin)
+
+* SOLR-5263: Fix CloudSolrServer URL cache update race. (Jessica Cheng, Mark Miller)
+
+* SOLR-5297: Admin UI - Threads Screen missing Icon (steffkes)
+
+* SOLR-5301: DELETEALIAS command prints CREATEALIAS in logs (janhoy)
+
+* SOLR-5255: Remove unnecessary call to fetch and watch live nodes in ZkStateReader
+  cluster watcher. (Jessica Cheng via shalin)
+
+* SOLR-5305: Admin UI - Reloading System-Information on Dashboard does not work
+  anymore (steffkes)
+
+* SOLR-5314: Shard split action should use soft commits instead of hard commits
+  to make sub shard data visible. (Kalle Aaltonen, shalin)
+
 ==================  4.5.0 ==================
 
 Versions of Major Components

Modified: lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/cloud/Overseer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/cloud/Overseer.java?rev=1530861&r1=1530860&r2=1530861&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/cloud/Overseer.java (original)
+++ lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/cloud/Overseer.java Thu Oct 10 06:54:36 2013
@@ -413,10 +413,11 @@ public class Overseer {
       }
 
       private ClusterState createCollection(ClusterState state, String collectionName, List<String> shards , ZkNodeProps message) {
-        log.info("Create collection {} with shards {}", collectionName, shards);;
+        log.info("Create collection {} with shards {}", collectionName, shards);
 
-//        String routerName = message.getStr(OverseerCollectionProcessor.ROUTER,DocRouter.DEFAULT_NAME);
-        DocRouter router = DocRouter.getDocRouter(message.getStr(OverseerCollectionProcessor.ROUTER,DocRouter.DEFAULT_NAME));
+        Map<String, Object> routerSpec = DocRouter.getRouterSpec(message);
+        String routerName = routerSpec.get("name") == null ? DocRouter.DEFAULT_NAME : (String) routerSpec.get("name");
+        DocRouter router = DocRouter.getDocRouter(routerName);
 
         List<DocRouter.Range> ranges = router.partitionRange(shards.size(), router.fullRange());
 
@@ -447,7 +448,7 @@ public class Overseer {
           }
           if(val != null) collectionProps.put(e.getKey(),val);
         }
-        collectionProps.put(DocCollection.DOC_ROUTER, DocRouter.getRouterSpec(message));
+        collectionProps.put(DocCollection.DOC_ROUTER, routerSpec);
 
         DocCollection newCollection = new DocCollection(collectionName, newSlices, collectionProps, router);
 

Modified: lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java?rev=1530861&r1=1530860&r2=1530861&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java (original)
+++ lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java Thu Oct 10 06:54:36 2013
@@ -386,7 +386,7 @@ public class OverseerCollectionProcessor
   }
 
   private boolean createShard(ClusterState clusterState, ZkNodeProps message, NamedList results) throws KeeperException, InterruptedException {
-    log.info("create shard invoked");
+    log.info("Create shard invoked: {}", message);
     String collectionName = message.getStr(COLLECTION_PROP);
     String shard = message.getStr(SHARD_ID_PROP);
     if(collectionName == null || shard ==null)
@@ -395,19 +395,18 @@ public class OverseerCollectionProcessor
 
     DocCollection collection = clusterState.getCollection(collectionName);
     int maxShardsPerNode = collection.getInt(MAX_SHARDS_PER_NODE, 1);
-    int repFactor = message.getInt(REPLICATION_FACTOR, collection.getInt(MAX_SHARDS_PER_NODE, 1));
-//    int minReplicas = message.getInt("minReplicas",repFactor);
-    String createNodeSetStr =message.getStr(CREATE_NODE_SET);
+    int repFactor = message.getInt(REPLICATION_FACTOR, collection.getInt(REPLICATION_FACTOR, 1));
+    String createNodeSetStr = message.getStr(CREATE_NODE_SET);
 
     ArrayList<Node> sortedNodeList = getNodesForNewShard(clusterState, collectionName, numSlices, maxShardsPerNode, repFactor, createNodeSetStr);
 
     Overseer.getInQueue(zkStateReader.getZkClient()).offer(ZkStateReader.toJSON(message));
-    // wait for a while until we don't see the collection
+    // wait for a while until we see the shard
     long waitUntil = System.currentTimeMillis() + 30000;
     boolean created = false;
     while (System.currentTimeMillis() < waitUntil) {
       Thread.sleep(100);
-      created = zkStateReader.getClusterState().getCollection(collectionName).getSlice(shard) !=null;
+      created = zkStateReader.getClusterState().getCollection(collectionName).getSlice(shard) != null;
       if (created) break;
     }
     if (!created)
@@ -677,16 +676,17 @@ public class OverseerCollectionProcessor
       collectShardResponses(results, true,
           "SPLTSHARD failed to create subshard replicas or timed out waiting for them to come up");
 
+      log.info("Calling soft commit to make sub shard updates visible");
       String coreUrl = new ZkCoreNodeProps(parentShardLeader).getCoreUrl();
       // HttpShardHandler is hard coded to send a QueryRequest hence we go direct
       // and we force open a searcher so that we have documents to show upon switching states
       UpdateResponse updateResponse = null;
       try {
-        updateResponse = commit(coreUrl, true);
+        updateResponse = softCommit(coreUrl);
         processResponse(results, null, coreUrl, updateResponse, slice);
       } catch (Exception e) {
         processResponse(results, e, coreUrl, updateResponse, slice);
-        throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to call distrib commit on: " + coreUrl, e);
+        throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to call distrib softCommit on: " + coreUrl, e);
       }
 
       log.info("Successfully created all replica shards for all sub-slices "
@@ -713,16 +713,15 @@ public class OverseerCollectionProcessor
     }
   }
 
-  static UpdateResponse commit(String url, boolean openSearcher) throws SolrServerException, IOException {
+  static UpdateResponse softCommit(String url) throws SolrServerException, IOException {
     HttpSolrServer server = null;
     try {
       server = new HttpSolrServer(url);
       server.setConnectionTimeout(30000);
-      server.setSoTimeout(60000);
+      server.setSoTimeout(120000);
       UpdateRequest ureq = new UpdateRequest();
       ureq.setParams(new ModifiableSolrParams());
-      ureq.getParams().set(UpdateParams.OPEN_SEARCHER, openSearcher);
-      ureq.setAction(AbstractUpdateRequest.ACTION.COMMIT, false, true);
+      ureq.setAction(AbstractUpdateRequest.ACTION.COMMIT, false, true, true);
       return ureq.process(server);
     } finally {
       if (server != null) {

Modified: lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java?rev=1530861&r1=1530860&r2=1530861&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java (original)
+++ lucene/dev/branches/lucene_solr_4_5/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java Thu Oct 10 06:54:36 2013
@@ -111,6 +111,12 @@ public class CollectionsHandler extends 
               "Core container instance missing");
     }
 
+    // Make sure that the core is ZKAware
+    if(!cores.isZooKeeperAware()) {
+      throw new SolrException(ErrorCode.BAD_REQUEST,
+          "Solr instance is not running in SolrCloud mode.");
+    }
+
     // Pick the action
     SolrParams params = req.getParams();
     CollectionAction action = null;
@@ -256,7 +262,7 @@ public class CollectionsHandler extends 
     ZkNodeProps m = new ZkNodeProps(Overseer.QUEUE_OPERATION,
         OverseerCollectionProcessor.DELETEALIAS, "name", name);
     
-    handleResponse(OverseerCollectionProcessor.CREATEALIAS, m, rsp);
+    handleResponse(OverseerCollectionProcessor.DELETEALIAS, m, rsp);
   }
 
   private void handleDeleteAction(SolrQueryRequest req, SolrQueryResponse rsp) throws KeeperException, InterruptedException {

Modified: lucene/dev/branches/lucene_solr_4_5/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_5/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java?rev=1530861&r1=1530860&r2=1530861&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_5/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java (original)
+++ lucene/dev/branches/lucene_solr_4_5/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java Thu Oct 10 06:54:36 2013
@@ -135,6 +135,7 @@ public class CustomCollectionTest extend
   public void doTest() throws Exception {
     testCustomCollectionsAPI();
     testRouteFieldForHashRouter();
+    testCreateShardRepFactor();
     if (DEBUG) {
       super.printLayout();
     }
@@ -201,7 +202,7 @@ public class CustomCollectionTest extend
       List<Integer> list = entry.getValue();
       checkForCollection(collection, list, null);
 
-      String url = getUrlFromZk(collection);
+      String url = getUrlFromZk(getCommonCloudSolrServer().getZkStateReader().getClusterState(), collection);
 
       HttpSolrServer collectionClient = new HttpSolrServer(url);
 
@@ -219,6 +220,8 @@ public class CustomCollectionTest extend
     assertEquals("implicit", ((Map)coll.get(ROUTER)).get("name") );
     assertNotNull(coll.getStr(REPLICATION_FACTOR));
     assertNotNull(coll.getStr(MAX_SHARDS_PER_NODE));
+    assertNull("A shard of a Collection configured with implicit router must have null range",
+        coll.getSlice("a").getRange());
 
     List<String> collectionNameList = new ArrayList<String>();
     collectionNameList.addAll(collectionInfos.keySet());
@@ -226,7 +229,7 @@ public class CustomCollectionTest extend
 
     String collectionName = collectionNameList.get(random().nextInt(collectionNameList.size()));
 
-    String url = getUrlFromZk(collectionName);
+    String url = getUrlFromZk(getCommonCloudSolrServer().getZkStateReader().getClusterState(), collectionName);
 
     HttpSolrServer collectionClient = new HttpSolrServer(url);
 
@@ -325,7 +328,7 @@ public class CustomCollectionTest extend
     checkForCollection(collectionName, list, null);
 
 
-    url = getUrlFromZk(collectionName);
+    url = getUrlFromZk(getCommonCloudSolrServer().getZkStateReader().getClusterState(), collectionName);
 
     collectionClient = new HttpSolrServer(url);
 
@@ -386,7 +389,7 @@ public class CustomCollectionTest extend
     checkForCollection(collectionName, list, null);
 
 
-    String url = getUrlFromZk(collectionName);
+    String url = getUrlFromZk(getCommonCloudSolrServer().getZkStateReader().getClusterState(), collectionName);
 
     HttpSolrServer collectionClient = new HttpSolrServer(url);
 
@@ -417,11 +420,52 @@ public class CustomCollectionTest extend
 
   }
 
+  private void testCreateShardRepFactor() throws Exception  {
+    String collectionName = "testCreateShardRepFactor";
+    HashMap<String, List<Integer>> collectionInfos = new HashMap<String, List<Integer>>();
+    CloudSolrServer client = null;
+    try {
+      client = createCloudClient(null);
+      Map<String, Object> props = ZkNodeProps.makeMap(
+          REPLICATION_FACTOR, 1,
+          MAX_SHARDS_PER_NODE, 5,
+          NUM_SLICES, 2,
+          "shards", "a,b",
+          "router.name", "implicit");
 
+      createCollection(collectionInfos, collectionName, props, client);
+    } finally {
+      if (client != null) client.shutdown();
+    }
+    ZkStateReader zkStateReader = getCommonCloudSolrServer().getZkStateReader();
+    waitForRecoveriesToFinish(collectionName, zkStateReader, false);
+
+    ModifiableSolrParams params = new ModifiableSolrParams();
+    params.set("action", CollectionAction.CREATESHARD.toString());
+    params.set("collection", collectionName);
+    params.set("shard", "x");
+    SolrRequest request = new QueryRequest(params);
+    request.setPath("/admin/collections");
+    createNewSolrServer("", getBaseUrl((HttpSolrServer) clients.get(0))).request(request);
+
+    waitForRecoveriesToFinish(collectionName, zkStateReader, false);
+
+    int replicaCount = 0;
+    int attempts = 0;
+    while (true) {
+      if (attempts > 30) fail("Not enough active replicas in the shard 'x'");
+      zkStateReader.updateClusterState(true);
+      attempts++;
+      replicaCount = zkStateReader.getClusterState().getSlice(collectionName, "x").getReplicas().size();
+      if (replicaCount >= 1) break;
+      Thread.sleep(500);
+    }
+
+    assertEquals("CREATESHARD API created more than replicationFactor number of replicas", 1, replicaCount);
+  }
 
 
-  private String getUrlFromZk(String collection) {
-    ClusterState clusterState = getCommonCloudSolrServer().getZkStateReader().getClusterState();
+  public static String getUrlFromZk(ClusterState clusterState, String collection) {
     Map<String,Slice> slices = clusterState.getCollectionStates().get(collection).getSlicesMap();
 
     if (slices == null) {

Modified: lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java?rev=1530861&r1=1530860&r2=1530861&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java (original)
+++ lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java Thu Oct 10 06:54:36 2013
@@ -88,15 +88,6 @@ public class CloudSolrServer extends Sol
   private HttpClient myClient;
   Random rand = new Random();
   
-  private Object cachLock = new Object();
-  // since the state shouldn't change often, should be very cheap reads
-  private Map<String,List<String>> urlLists = new HashMap<String,List<String>>();
-  private Map<String,List<String>> leaderUrlLists = new HashMap<String,List<String>>();
-
-  private Map<String,List<String>> replicasLists = new HashMap<String,List<String>>();
-  
-  private volatile int lastClusterStateHashCode;
-  
   private final boolean updatesToLeaders;
   private boolean parallelUpdates = true;
   private ExecutorService threadPool = Executors
@@ -497,14 +488,15 @@ public class CloudSolrServer extends Sol
     connect();
     
     ClusterState clusterState = zkStateReader.getClusterState();
-
+    
     boolean sendToLeaders = false;
     List<String> replicas = null;
     
     if (request instanceof IsUpdateRequest) {
-      if(request instanceof UpdateRequest) {
-        NamedList response = directUpdate((AbstractUpdateRequest)request,clusterState);
-        if(response != null) {
+      if (request instanceof UpdateRequest) {
+        NamedList response = directUpdate((AbstractUpdateRequest) request,
+            clusterState);
+        if (response != null) {
           return response;
         }
       }
@@ -517,13 +509,16 @@ public class CloudSolrServer extends Sol
       reqParams = new ModifiableSolrParams();
     }
     List<String> theUrlList = new ArrayList<String>();
-    if (request.getPath().equals("/admin/collections") || request.getPath().equals("/admin/cores")) {
+    if (request.getPath().equals("/admin/collections")
+        || request.getPath().equals("/admin/cores")) {
       Set<String> liveNodes = clusterState.getLiveNodes();
       for (String liveNode : liveNodes) {
         int splitPointBetweenHostPortAndContext = liveNode.indexOf("_");
         theUrlList.add("http://"
-            + liveNode.substring(0, splitPointBetweenHostPortAndContext) + "/"
-            + URLDecoder.decode(liveNode, "UTF-8").substring(splitPointBetweenHostPortAndContext + 1));
+            + liveNode.substring(0, splitPointBetweenHostPortAndContext)
+            + "/"
+            + URLDecoder.decode(liveNode, "UTF-8").substring(
+                splitPointBetweenHostPortAndContext + 1));
       }
     } else {
       String collection = reqParams.get("collection", defaultCollection);
@@ -535,14 +530,15 @@ public class CloudSolrServer extends Sol
       
       Set<String> collectionsList = getCollectionList(clusterState, collection);
       if (collectionsList.size() == 0) {
-        throw new SolrException(ErrorCode.BAD_REQUEST, "Could not find collection: " + collection);
+        throw new SolrException(ErrorCode.BAD_REQUEST,
+            "Could not find collection: " + collection);
       }
       collection = collectionsList.iterator().next();
       
       StringBuilder collectionString = new StringBuilder();
       Iterator<String> it = collectionsList.iterator();
       for (int i = 0; i < collectionsList.size(); i++) {
-        String col = it.next(); 
+        String col = it.next();
         collectionString.append(col);
         if (i < collectionsList.size() - 1) {
           collectionString.append(",");
@@ -557,75 +553,67 @@ public class CloudSolrServer extends Sol
       // add it to the Map of slices.
       Map<String,Slice> slices = new HashMap<String,Slice>();
       for (String collectionName : collectionsList) {
-        Collection<Slice> colSlices = clusterState.getActiveSlices(collectionName);
+        Collection<Slice> colSlices = clusterState
+            .getActiveSlices(collectionName);
         if (colSlices == null) {
-          throw new SolrServerException("Could not find collection:" + collectionName);
+          throw new SolrServerException("Could not find collection:"
+              + collectionName);
         }
         ClientUtils.addSlices(slices, collectionName, colSlices, true);
       }
       Set<String> liveNodes = clusterState.getLiveNodes();
       
-      synchronized (cachLock) {
-        List<String> leaderUrlList = leaderUrlLists.get(collection);
-        List<String> urlList = urlLists.get(collection);
-        List<String> replicasList = replicasLists.get(collection);
-        
-        if ((sendToLeaders && leaderUrlList == null)
-            || (!sendToLeaders && urlList == null)
-            || clusterState.hashCode() != this.lastClusterStateHashCode) {
-          // build a map of unique nodes
-          // TODO: allow filtering by group, role, etc
-          Map<String,ZkNodeProps> nodes = new HashMap<String,ZkNodeProps>();
-          List<String> urlList2 = new ArrayList<String>();
-          for (Slice slice : slices.values()) {
-            for (ZkNodeProps nodeProps : slice.getReplicasMap().values()) {
-              ZkCoreNodeProps coreNodeProps = new ZkCoreNodeProps(nodeProps);
-              String node = coreNodeProps.getNodeName();
-              if (!liveNodes.contains(coreNodeProps.getNodeName())
-                  || !coreNodeProps.getState().equals(ZkStateReader.ACTIVE)) continue;
-              if (nodes.put(node, nodeProps) == null) {
-                if (!sendToLeaders
-                    || (sendToLeaders && coreNodeProps.isLeader())) {
-                  String url = coreNodeProps.getCoreUrl();
-                  urlList2.add(url);
-                } else if (sendToLeaders) {
-                  String url = coreNodeProps.getCoreUrl();
-                  replicas.add(url);
-                }
-              }
+      List<String> leaderUrlList = null;
+      List<String> urlList = null;
+      List<String> replicasList = null;
+      
+      // build a map of unique nodes
+      // TODO: allow filtering by group, role, etc
+      Map<String,ZkNodeProps> nodes = new HashMap<String,ZkNodeProps>();
+      List<String> urlList2 = new ArrayList<String>();
+      for (Slice slice : slices.values()) {
+        for (ZkNodeProps nodeProps : slice.getReplicasMap().values()) {
+          ZkCoreNodeProps coreNodeProps = new ZkCoreNodeProps(nodeProps);
+          String node = coreNodeProps.getNodeName();
+          if (!liveNodes.contains(coreNodeProps.getNodeName())
+              || !coreNodeProps.getState().equals(ZkStateReader.ACTIVE)) continue;
+          if (nodes.put(node, nodeProps) == null) {
+            if (!sendToLeaders || (sendToLeaders && coreNodeProps.isLeader())) {
+              String url = coreNodeProps.getCoreUrl();
+              urlList2.add(url);
+            } else if (sendToLeaders) {
+              String url = coreNodeProps.getCoreUrl();
+              replicas.add(url);
             }
           }
-          
-          if (sendToLeaders) {
-            this.leaderUrlLists.put(collection, urlList2);
-            leaderUrlList = urlList2;
-            this.replicasLists.put(collection, replicas);
-            replicasList = replicas;
-          } else {
-            this.urlLists.put(collection, urlList2);
-            urlList = urlList2;
-          }
-          this.lastClusterStateHashCode = clusterState.hashCode();
-        }
-        
-        if (sendToLeaders) {
-          theUrlList = new ArrayList<String>(leaderUrlList.size());
-          theUrlList.addAll(leaderUrlList);
-        } else {
-          theUrlList = new ArrayList<String>(urlList.size());
-          theUrlList.addAll(urlList);
-        }
-        Collections.shuffle(theUrlList, rand);
-        if (sendToLeaders) {
-          ArrayList<String> theReplicas = new ArrayList<String>(
-              replicasList.size());
-          theReplicas.addAll(replicasList);
-          Collections.shuffle(theReplicas, rand);
-          // System.out.println("leaders:" + theUrlList);
-          // System.out.println("replicas:" + theReplicas);
-          theUrlList.addAll(theReplicas);
         }
       }
+      
+      if (sendToLeaders) {
+        leaderUrlList = urlList2;
+        replicasList = replicas;
+      } else {
+        urlList = urlList2;
+      }
+      
+      if (sendToLeaders) {
+        theUrlList = new ArrayList<String>(leaderUrlList.size());
+        theUrlList.addAll(leaderUrlList);
+      } else {
+        theUrlList = new ArrayList<String>(urlList.size());
+        theUrlList.addAll(urlList);
+      }
+      Collections.shuffle(theUrlList, rand);
+      if (sendToLeaders) {
+        ArrayList<String> theReplicas = new ArrayList<String>(
+            replicasList.size());
+        theReplicas.addAll(replicasList);
+        Collections.shuffle(theReplicas, rand);
+        // System.out.println("leaders:" + theUrlList);
+        // System.out.println("replicas:" + theReplicas);
+        theUrlList.addAll(theReplicas);
+      }
+      
     }
     
     // System.out.println("########################## MAKING REQUEST TO " +
@@ -691,19 +679,4 @@ public class CloudSolrServer extends Sol
     return updatesToLeaders;
   }
 
-  // for tests
-  Map<String,List<String>> getUrlLists() {
-    return urlLists;
-  }
-
-  //for tests
-  Map<String,List<String>> getLeaderUrlLists() {
-    return leaderUrlLists;
-  }
-
-  //for tests
-  Map<String,List<String>> getReplicasLists() {
-    return replicasLists;
-  }
-
 }

Modified: lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java?rev=1530861&r1=1530860&r2=1530861&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java (original)
+++ lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java Thu Oct 10 06:54:36 2013
@@ -218,11 +218,6 @@ public class ZkStateReader {
               Stat stat = new Stat();
               byte[] data = zkClient.getData(CLUSTER_STATE, thisWatch, stat ,
                   true);
-              List<String> liveNodes = zkClient.getChildren(
-                  LIVE_NODES_ZKNODE, this, true);
-     
-              Set<String> liveNodesSet = new HashSet<String>();
-              liveNodesSet.addAll(liveNodes);
               Set<String> ln = ZkStateReader.this.clusterState.getLiveNodes();
               ClusterState clusterState = ClusterState.load(stat.getVersion(), data, ln);
               // update volatile

Modified: lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java?rev=1530861&r1=1530860&r2=1530861&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java (original)
+++ lucene/dev/branches/lucene_solr_4_5/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java Thu Oct 10 06:54:36 2013
@@ -194,53 +194,7 @@ public class CloudSolrServerTest extends
     
     del("*:*");
     commit();
-    
-    indexr(id, 0, "a_t", "to come to the aid of their country.");
-    
-    CloudJettyRunner shard1Leader = shardToLeaderJetty.get("shard1");
-    CloudJettyRunner shard2Leader = shardToLeaderJetty.get("shard2");
-    
-    if (cloudClient.isUpdatesToLeaders()) {
-      // compare leaders list
-      assertEquals(2, cloudClient.getLeaderUrlLists().get("collection1").size());
-      HashSet<String> leaderUrlSet = new HashSet<String>();
-      leaderUrlSet.addAll(cloudClient.getLeaderUrlLists().get("collection1"));
-      assertTrue("fail check for leader:" + shard1Leader.url + " in "
-          + leaderUrlSet, leaderUrlSet.contains(shard1Leader.url + "/"));
-      assertTrue("fail check for leader:" + shard2Leader.url + " in "
-          + leaderUrlSet, leaderUrlSet.contains(shard2Leader.url + "/"));
-      
-      // compare replicas list
-      Set<String> replicas = new HashSet<String>();
-      List<CloudJettyRunner> jetties = shardToJetty.get("shard1");
-      for (CloudJettyRunner cjetty : jetties) {
-        replicas.add(cjetty.url);
-      }
-      jetties = shardToJetty.get("shard2");
-      for (CloudJettyRunner cjetty : jetties) {
-        replicas.add(cjetty.url);
-      }
-      replicas.remove(shard1Leader.url);
-      replicas.remove(shard2Leader.url);
-      
-      assertEquals(replicas.size(),
-          cloudClient.getReplicasLists().get("collection1").size());
-      
-      for (String url : cloudClient.getReplicasLists().get("collection1")) {
-        assertTrue("fail check for replica:" + url + " in " + replicas,
-            replicas.contains(stripTrailingSlash(url)));
-      }
-    }
-    
   }
-
-  private String stripTrailingSlash(String url) {
-    if (url.endsWith("/")) {
-      return url.substring(0, url.length() - 1);
-    }
-    return url;
-  }
-  
   
   @Override
   protected void indexr(Object... fields) throws Exception {

Modified: lucene/dev/branches/lucene_solr_4_5/solr/webapp/web/css/styles/threads.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_5/solr/webapp/web/css/styles/threads.css?rev=1530861&r1=1530860&r2=1530861&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_5/solr/webapp/web/css/styles/threads.css (original)
+++ lucene/dev/branches/lucene_solr_4_5/solr/webapp/web/css/styles/threads.css Thu Oct 10 06:54:36 2013
@@ -71,7 +71,7 @@ limitations under the License.
 }
 
 #content #threads #thread-dump tbody .WAITING a,
-#content #threads #thread-dump tbody .TIMED_WAITING .a
+#content #threads #thread-dump tbody .TIMED_WAITING a
 {
   background-image: url( ../../img/ico/hourglass.png );
 }

Modified: lucene/dev/branches/lucene_solr_4_5/solr/webapp/web/js/scripts/index.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_5/solr/webapp/web/js/scripts/index.js?rev=1530861&r1=1530860&r2=1530861&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_5/solr/webapp/web/js/scripts/index.js (original)
+++ lucene/dev/branches/lucene_solr_4_5/solr/webapp/web/js/scripts/index.js Thu Oct 10 06:54:36 2013
@@ -303,7 +303,7 @@ sammy.get
                 $.ajax
                 (
                   {
-                    url : environment_basepath + '/admin/system?wt=json',
+                    url : config.solr_path + '/admin/info/system?wt=json',
                     dataType : 'json',
                     context : this,
                     beforeSend : function( arr, form, options )
@@ -337,4 +337,4 @@ sammy.get
       }
     );
   }
-);
\ No newline at end of file
+);