mirror of https://github.com/apache/lucene.git
SOLR-4926: remove some silliness
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1494160 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2cb61149e4
commit
e1005a0645
|
@ -118,19 +118,14 @@ public class RecoveryStrategy extends Thread implements ClosableThread {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void replicate(String nodeName, SolrCore core, ZkNodeProps leaderprops, String baseUrl)
|
private void replicate(String nodeName, SolrCore core, ZkNodeProps leaderprops)
|
||||||
throws SolrServerException, IOException {
|
throws SolrServerException, IOException {
|
||||||
|
|
||||||
String leaderBaseUrl = leaderprops.getStr(ZkStateReader.BASE_URL_PROP);
|
|
||||||
ZkCoreNodeProps leaderCNodeProps = new ZkCoreNodeProps(leaderprops);
|
ZkCoreNodeProps leaderCNodeProps = new ZkCoreNodeProps(leaderprops);
|
||||||
String leaderUrl = leaderCNodeProps.getCoreUrl();
|
String leaderUrl = leaderCNodeProps.getCoreUrl();
|
||||||
|
|
||||||
log.info("Attempting to replicate from " + leaderUrl + ". core=" + coreName);
|
log.info("Attempting to replicate from " + leaderUrl + ". core=" + coreName);
|
||||||
|
|
||||||
// if we are the leader, either we are trying to recover faster
|
|
||||||
// then our ephemeral timed out or we are the only node
|
|
||||||
if (!leaderBaseUrl.equals(baseUrl)) {
|
|
||||||
|
|
||||||
// send commit
|
// send commit
|
||||||
commitOnLeader(leaderUrl);
|
commitOnLeader(leaderUrl);
|
||||||
|
|
||||||
|
@ -153,7 +148,8 @@ public class RecoveryStrategy extends Thread implements ClosableThread {
|
||||||
boolean success = replicationHandler.doFetch(solrParams, false);
|
boolean success = replicationHandler.doFetch(solrParams, false);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
throw new SolrException(ErrorCode.SERVER_ERROR, "Replication for recovery failed.");
|
throw new SolrException(ErrorCode.SERVER_ERROR,
|
||||||
|
"Replication for recovery failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// solrcloud_debug
|
// solrcloud_debug
|
||||||
|
@ -169,7 +165,7 @@ public class RecoveryStrategy extends Thread implements ClosableThread {
|
||||||
// } catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void commitOnLeader(String leaderUrl) throws SolrServerException, IOException {
|
private void commitOnLeader(String leaderUrl) throws SolrServerException, IOException {
|
||||||
|
@ -406,8 +402,7 @@ public class RecoveryStrategy extends Thread implements ClosableThread {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
replicate(zkController.getNodeName(), core,
|
replicate(zkController.getNodeName(), core, leaderprops);
|
||||||
leaderprops, leaderUrl);
|
|
||||||
|
|
||||||
replay(ulog);
|
replay(ulog);
|
||||||
replayed = true;
|
replayed = true;
|
||||||
|
|
Loading…
Reference in New Issue