You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2017/12/29 12:09:07 UTC
lucene-solr:jira/solr-11702: SOLR-11702: Postpone the optimization of
recovery process to another ticket
Repository: lucene-solr
Updated Branches:
refs/heads/jira/solr-11702 80044bce4 -> 09b964659
SOLR-11702: Postpone the optimization of recovery process to another ticket
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/09b96465
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/09b96465
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/09b96465
Branch: refs/heads/jira/solr-11702
Commit: 09b96465920c6905703d32287c7f2e4106835471
Parents: 80044bc
Author: Cao Manh Dat <da...@apache.org>
Authored: Fri Dec 29 19:08:55 2017 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Fri Dec 29 19:08:55 2017 +0700
----------------------------------------------------------------------
.../src/java/org/apache/solr/cloud/RecoveryStrategy.java | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/09b96465/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
index 2482123..9a05ffb 100644
--- a/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
+++ b/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
@@ -19,7 +19,6 @@ package org.apache.solr.cloud;
import java.io.Closeable;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
-import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.URL;
@@ -525,12 +524,8 @@ public class RecoveryStrategy implements Runnable, Closeable {
while (!successfulRecovery && !Thread.currentThread().isInterrupted() && !isClosed()) { // don't use interruption or it will close channels though
try {
CloudDescriptor cloudDesc = core.getCoreDescriptor().getCloudDescriptor();
- final Replica leader = checkConnectionToLeader(ourUrl, cloudDesc);
- if (isClosed()) {
- LOG.info("RecoveryStrategy has been closed");
- break;
- }
-
+ final Replica leader = zkStateReader.getLeaderRetry(cloudDesc.getCollectionName(), cloudDesc.getShardId());
+ //TODO we should try to ping to the leader to ensure the network is healthy
boolean isLeader = leader.getCoreUrl().equals(ourUrl);
if (isLeader && !cloudDesc.isLeader()) {
throw new SolrException(ErrorCode.SERVER_ERROR, "Cloud state still says we are leader.");