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:39:52 UTC

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

Repository: lucene-solr
Updated Branches:
  refs/heads/master ce3114233 -> 04bd58607


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/04bd5860
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/04bd5860
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/04bd5860

Branch: refs/heads/master
Commit: 04bd5860710ca5ab309d2e8b2e8fb36d3bf962bc
Parents: ce31142
Author: Alan Woodward <ro...@apache.org>
Authored: Mon Mar 21 17:39:37 2016 +0000
Committer: Alan Woodward <ro...@apache.org>
Committed: Mon Mar 21 17:39:37 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/04bd5860/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ce804f5..3c49ba9 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -20,6 +20,7 @@ See the Quick Start guide at http://lucene.apache.org/solr/quickstart.html
 (No Changes)
 
 ==================  6.1.0 ==================
+
 Detailed Change List
 ----------------------
 * SOLR-8782: Add asynchronous sugar methods to the SolrJ Collections API.  You
@@ -30,13 +31,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
@@ -282,8 +283,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/04bd5860/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();