You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2016/03/21 18:40:51 UTC

lucene-solr:branch_6x: SOLR-8837: Fix duplicate election node detection

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x faa077224 -> 451ff488a


SOLR-8837: Fix duplicate election node detection


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/451ff488
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/451ff488
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/451ff488

Branch: refs/heads/branch_6x
Commit: 451ff488afc4707cb8555c5629bcf0c9ebef210f
Parents: faa0772
Author: Alan Woodward <ro...@apache.org>
Authored: Mon Mar 21 17:39:37 2016 +0000
Committer: Alan Woodward <al...@romseysoftware.co.uk>
Committed: Mon Mar 21 17:40:19 2016 +0000

----------------------------------------------------------------------
 solr/CHANGES.txt                                        | 12 +++++++-----
 .../src/java/org/apache/solr/cloud/LeaderElector.java   |  5 +----
 2 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/451ff488/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index b386f6a..23e8e89 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -17,6 +17,7 @@ servlet container in the directory named "example".
 See the Quick Start guide at http://lucene.apache.org/solr/quickstart.html
 
 ==================  6.1.0 ==================
+
 Detailed Change List
 ----------------------
 * SOLR-8782: Add asynchronous sugar methods to the SolrJ Collections API.  You
@@ -27,13 +28,13 @@ Detailed Change List
 * SOLR-8765: Enforce required parameters at query construction time in the SolrJ
   Collections API, add static factory methods, and deprecate old setter methods.
   (Alan Woodward, Jason Gerlowski)
-* SOLR-8842: authorization APIs do not use name as an identifier for  a permission
-  for update, delete
  commands and 'before' attribute (noble)
+ 
+* SOLR-8842: authorization APIs do not use name as an identifier for a permission
+  for update, delete commands and 'before' attribute (noble)
 
 
 New Features
 ----------------------
-
 * SOLR-8814: Support GeoJSON response writer and general spatial formatting.  Adding
      &wt=geojson&geojson.field=<your geometry field>
   Will return a FeatureCollection for each SolrDocumentList and a Feature with the
@@ -276,8 +277,9 @@ Bug Fixes
   
 * SOLR-8656: PeerSync should use same nUpdates everywhere. (Ramsey Haddad via Mark Miller)
 
-* SOLR-8697: Scope ZK election nodes by session to prevent elections from interfering with each other
-  and other small LeaderElector improvements. (Scott Blum via Mark Miller)
+* SOLR-8697, SOLR-8837: Scope ZK election nodes by session to prevent elections from interfering with each other
+  and other small LeaderElector improvements. (Scott Blum via Mark Miller, Alan
+  Woodward)
 
 * SOLR-8599: After a failed connection during construction of SolrZkClient attempt to retry until a connection
   can be made. (Keith Laban, Dennis Gove)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/451ff488/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java b/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
index c0eb395..e71ddf0 100644
--- a/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
+++ b/solr/core/src/java/org/apache/solr/cloud/LeaderElector.java
@@ -18,16 +18,13 @@ package org.apache.solr.cloud;
 
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
-import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.solr.cloud.ZkController.ContextKey;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.cloud.SolrZkClient;
@@ -116,7 +113,7 @@ public  class LeaderElector {
 
     // If any double-registrations exist for me, remove all but this latest one!
     // TODO: can we even get into this state?
-    String prefix = zkClient.getSolrZooKeeper().getSessionId() + "-" + context.id;
+    String prefix = zkClient.getSolrZooKeeper().getSessionId() + "-" + context.id + "-";
     Iterator<String> it = seqs.iterator();
     while (it.hasNext()) {
       String elec = it.next();