mirror of https://github.com/apache/lucene.git
SOLR-7989: Revert changes.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1713882 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
989afcaf86
commit
e7329a7b83
|
@ -354,10 +354,8 @@ Bug Fixes
|
|||
a race condition can cause that client to hang in blockUntilFinished.
|
||||
(Mark Miller, yonik)
|
||||
|
||||
* SOLR-8215: Only active replicas should handle incoming requests against a collection (Varun Thacker)
|
||||
|
||||
* SOLR-7989: After a new leader is elected it should change it's state to ACTIVE even
|
||||
if the last published state is something else (Ishan Chattopadhyaya, Mark Miller via noble )
|
||||
* SOLR-8215: Only active replicas should handle incoming requests against a collection (Varun Thacker)
|
||||
|
||||
* SOLR-8223: Avoid accidentally swallowing OutOfMemoryError (in LeaderInitiatedRecoveryThread.java
|
||||
or CoreContainer.java) (Mike Drob via Christine Poerschke)
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.apache.lucene.search.MatchAllDocsQuery;
|
|||
import org.apache.solr.cloud.overseer.OverseerAction;
|
||||
import org.apache.solr.common.SolrException;
|
||||
import org.apache.solr.common.SolrException.ErrorCode;
|
||||
import org.apache.solr.common.cloud.ClusterState;
|
||||
import org.apache.solr.common.cloud.Replica;
|
||||
import org.apache.solr.common.cloud.Slice;
|
||||
import org.apache.solr.common.cloud.SolrZkClient;
|
||||
|
@ -108,7 +107,6 @@ class ShardLeaderElectionContextBase extends ElectionContext {
|
|||
private static Logger log = LoggerFactory
|
||||
.getLogger(ShardLeaderElectionContextBase.class);
|
||||
protected final SolrZkClient zkClient;
|
||||
protected ZkStateReader zkStateReader;
|
||||
protected String shardId;
|
||||
protected String collection;
|
||||
protected LeaderElector leaderElector;
|
||||
|
@ -121,7 +119,6 @@ class ShardLeaderElectionContextBase extends ElectionContext {
|
|||
+ "/leader_elect/" + shardId, ZkStateReader.getShardLeadersPath(
|
||||
collection, shardId), props, zkStateReader.getZkClient());
|
||||
this.leaderElector = leaderElector;
|
||||
this.zkStateReader = zkStateReader;
|
||||
this.zkClient = zkStateReader.getZkClient();
|
||||
this.shardId = shardId;
|
||||
this.collection = collection;
|
||||
|
@ -216,28 +213,13 @@ class ShardLeaderElectionContextBase extends ElectionContext {
|
|||
}
|
||||
|
||||
assert shardId != null;
|
||||
|
||||
ZkNodeProps m;
|
||||
ClusterState clusterState = zkStateReader.getClusterState();
|
||||
Replica rep = (clusterState == null) ? null : clusterState.getReplica(collection,
|
||||
leaderProps.getStr(ZkStateReader.CORE_NODE_NAME_PROP));
|
||||
if (rep != null && rep.getState() != Replica.State.ACTIVE) {
|
||||
m = ZkNodeProps.fromKeyVals(Overseer.QUEUE_OPERATION, OverseerAction.STATE.toLower(),
|
||||
ZkStateReader.STATE_PROP, Replica.State.ACTIVE.toString(),
|
||||
ZkStateReader.SHARD_ID_PROP, shardId,
|
||||
ZkStateReader.COLLECTION_PROP, collection,
|
||||
ZkStateReader.BASE_URL_PROP, leaderProps.getProperties().get(ZkStateReader.BASE_URL_PROP),
|
||||
ZkStateReader.NODE_NAME_PROP, leaderProps.getProperties().get(ZkStateReader.NODE_NAME_PROP),
|
||||
ZkStateReader.CORE_NODE_NAME_PROP, leaderProps.getProperties().get(ZkStateReader.CORE_NODE_NAME_PROP),
|
||||
ZkStateReader.CORE_NAME_PROP, leaderProps.getProperties().get(ZkStateReader.CORE_NAME_PROP));
|
||||
Overseer.getInQueue(zkClient).offer(Utils.toJSON(m));
|
||||
}
|
||||
|
||||
m = ZkNodeProps.fromKeyVals(Overseer.QUEUE_OPERATION, OverseerAction.LEADER.toLower(),
|
||||
ZkStateReader.SHARD_ID_PROP, shardId,
|
||||
ZkStateReader.COLLECTION_PROP, collection,
|
||||
ZkStateReader.BASE_URL_PROP, leaderProps.getProperties().get(ZkStateReader.BASE_URL_PROP),
|
||||
ZkStateReader.CORE_NAME_PROP, leaderProps.getProperties().get(ZkStateReader.CORE_NAME_PROP));
|
||||
ZkNodeProps m = ZkNodeProps.fromKeyVals(Overseer.QUEUE_OPERATION,
|
||||
OverseerAction.LEADER.toLower(), ZkStateReader.SHARD_ID_PROP, shardId,
|
||||
ZkStateReader.COLLECTION_PROP, collection, ZkStateReader.BASE_URL_PROP,
|
||||
leaderProps.getProperties().get(ZkStateReader.BASE_URL_PROP),
|
||||
ZkStateReader.CORE_NAME_PROP,
|
||||
leaderProps.getProperties().get(ZkStateReader.CORE_NAME_PROP),
|
||||
ZkStateReader.STATE_PROP, Replica.State.ACTIVE.toString());
|
||||
Overseer.getInQueue(zkClient).offer(Utils.toJSON(m));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue