SOLR-11702: Remove old LIR call in SolrCmdDistributor and let DistributedUpdateProcessor handle it on finish()

This commit is contained in:
Cao Manh Dat 2018-03-02 14:29:18 +07:00
parent 23aee00213
commit f1ce5419ee
2 changed files with 9 additions and 17 deletions

View File

@ -278,24 +278,14 @@ public class SolrCmdDistributor implements Closeable {
try (HttpSolrClient client = new HttpSolrClient.Builder(req.node.getUrl()).withHttpClient(clients.getHttpClient()).build()) {
client.request(req.uReq);
} catch (Exception e) {
try {
// if false, then the node is probably not "live" anymore
// and we do not need to send a recovery message
Throwable rootCause = SolrException.getRootCause(e);
log.error("Setting up to try to start recovery on replica {}", req.node.getUrl(), rootCause);
req.cmd.getReq().getCore().getCoreContainer().getZkController().ensureReplicaInLeaderInitiatedRecovery(
req.cmd.getReq().getCore().getCoreContainer(),
req.node.getCollection(),
req.node.getShardId(),
req.node.getNodeProps(),
req.cmd.getReq().getCore().getCoreDescriptor(),
false /* forcePublishState */
);
} catch (Exception exc) {
Throwable setLirZnodeFailedCause = SolrException.getRootCause(exc);
log.error("Leader failed to set replica " +
req.node.getUrl() + " state to DOWN due to: " + setLirZnodeFailedCause, setLirZnodeFailedCause);
SolrException.log(log, e);
Error error = new Error();
error.e = e;
error.req = req;
if (e instanceof SolrException) {
error.statusCode = ((SolrException) e).code();
}
errors.add(error);
}
return;

View File

@ -882,6 +882,8 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
log.warn("Core "+cloudDesc.getCoreNodeName()+" belonging to "+collection+" "+
shardId+", does not have error'd node " + stdNode.getNodeProps().getCoreUrl() + " as a replica. " +
"No request recovery command will be sent!");
// some replicas did not receive the updates, exception must be notified to clients
errorsForClient.add(error);
} else {
log.warn("Core " + cloudDesc.getCoreNodeName() + " is no longer the leader for " + collection + " "
+ shardId + " or we tried to put ourself into LIR, no request recovery command will be sent!");