SOLR-8837: Fix duplicate election node detection

This commit is contained in:
Alan Woodward 2016-03-21 17:39:37 +00:00
parent ce3114233b
commit 04bd586071
2 changed files with 8 additions and 9 deletions

View File

@ -20,6 +20,7 @@ See the Quick Start guide at http://lucene.apache.org/solr/quickstart.html
(No Changes) (No Changes)
================== 6.1.0 ================== ================== 6.1.0 ==================
Detailed Change List Detailed Change List
---------------------- ----------------------
* SOLR-8782: Add asynchronous sugar methods to the SolrJ Collections API. You * 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 * SOLR-8765: Enforce required parameters at query construction time in the SolrJ
Collections API, add static factory methods, and deprecate old setter methods. Collections API, add static factory methods, and deprecate old setter methods.
(Alan Woodward, Jason Gerlowski) (Alan Woodward, Jason Gerlowski)
* SOLR-8842: authorization APIs do not use name as an identifier for a permission * SOLR-8842: authorization APIs do not use name as an identifier for a permission
for update, delete commands and 'before' attribute (noble) for update, delete commands and 'before' attribute (noble)
New Features New Features
---------------------- ----------------------
* SOLR-8814: Support GeoJSON response writer and general spatial formatting. Adding * SOLR-8814: Support GeoJSON response writer and general spatial formatting. Adding
&wt=geojson&geojson.field=<your geometry field> &wt=geojson&geojson.field=<your geometry field>
Will return a FeatureCollection for each SolrDocumentList and a Feature with the 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-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 * 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) 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 * SOLR-8599: After a failed connection during construction of SolrZkClient attempt to retry until a connection
can be made. (Keith Laban, Dennis Gove) can be made. (Keith Laban, Dennis Gove)

View File

@ -18,16 +18,13 @@ package org.apache.solr.cloud;
import java.io.IOException; import java.io.IOException;
import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
import org.apache.solr.cloud.ZkController.ContextKey; import org.apache.solr.cloud.ZkController.ContextKey;
import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException;
import org.apache.solr.common.cloud.SolrZkClient; 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! // If any double-registrations exist for me, remove all but this latest one!
// TODO: can we even get into this state? // 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(); Iterator<String> it = seqs.iterator();
while (it.hasNext()) { while (it.hasNext()) {
String elec = it.next(); String elec = it.next();