SOLR-10169: PeerSync will hit an NPE on no response errors when looking for fingerprint.

This commit is contained in:
Erick Erickson 2018-04-16 21:51:02 -07:00
parent 7edfd9c410
commit a417a2cd6a
2 changed files with 10 additions and 4 deletions

View File

@ -161,7 +161,9 @@ Bug Fixes
(Amrit Sarkar, Varun Thacker)
* SOLR-11840: Fix bin/solr help-text inconsistencies (Jason Gerlowski)
* SOLR-10169: PeerSync will hit an NPE on no response errors when looking for fingerprint. (Erick Erickson)
Optimizations
----------------------

View File

@ -388,9 +388,13 @@ public class PeerSync implements SolrMetricProducer {
ShardResponse srsp = shardHandler.takeCompletedOrError();
if (srsp == null) break;
Object replicaFingerprint = srsp.getSolrResponse().getResponse().get("fingerprint");
Object replicaFingerprint = null;
if (srsp.getSolrResponse() != null && srsp.getSolrResponse().getResponse() != null) {
replicaFingerprint = srsp.getSolrResponse().getResponse().get("fingerprint");
}
if (replicaFingerprint == null) {
log.warn("Replica did not return a fingerprint - possibly an older Solr version");
log.warn("Replica did not return a fingerprint - possibly an older Solr version or exception");
continue;
}
@ -402,7 +406,7 @@ public class PeerSync implements SolrMetricProducer {
return true;
}
} catch(IOException e) {
log.warn("Could not cofirm if we are already in sync. Continue with PeerSync");
log.warn("Could not confirm if we are already in sync. Continue with PeerSync");
}
}