mirror of https://github.com/apache/lucene.git
tests: set request info on SyncStrategy for better logging
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1543205 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2115c05de9
commit
d6e1114002
|
@ -43,6 +43,10 @@ import org.apache.solr.handler.component.HttpShardHandlerFactory;
|
|||
import org.apache.solr.handler.component.ShardHandler;
|
||||
import org.apache.solr.handler.component.ShardRequest;
|
||||
import org.apache.solr.handler.component.ShardResponse;
|
||||
import org.apache.solr.request.LocalSolrQueryRequest;
|
||||
import org.apache.solr.request.SolrQueryRequest;
|
||||
import org.apache.solr.request.SolrRequestInfo;
|
||||
import org.apache.solr.response.SolrQueryResponse;
|
||||
import org.apache.solr.update.PeerSync;
|
||||
import org.apache.solr.util.DefaultSolrThreadFactory;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -86,17 +90,25 @@ public class SyncStrategy {
|
|||
if (SKIP_AUTO_RECOVERY) {
|
||||
return true;
|
||||
}
|
||||
if (isClosed) {
|
||||
log.warn("Closed, skipping sync up.");
|
||||
return false;
|
||||
boolean success;
|
||||
SolrQueryRequest req = new LocalSolrQueryRequest(core, new ModifiableSolrParams());
|
||||
SolrQueryResponse rsp = new SolrQueryResponse();
|
||||
SolrRequestInfo.setRequestInfo(new SolrRequestInfo(req, rsp));
|
||||
try {
|
||||
if (isClosed) {
|
||||
log.warn("Closed, skipping sync up.");
|
||||
return false;
|
||||
}
|
||||
log.info("Sync replicas to " + ZkCoreNodeProps.getCoreUrl(leaderProps));
|
||||
|
||||
if (core.getUpdateHandler().getUpdateLog() == null) {
|
||||
log.error("No UpdateLog found - cannot sync");
|
||||
return false;
|
||||
}
|
||||
success = syncReplicas(zkController, core, leaderProps);
|
||||
} finally {
|
||||
SolrRequestInfo.clearRequestInfo();
|
||||
}
|
||||
log.info("Sync replicas to " + ZkCoreNodeProps.getCoreUrl(leaderProps));
|
||||
|
||||
if (core.getUpdateHandler().getUpdateLog() == null) {
|
||||
log.error("No UpdateLog found - cannot sync");
|
||||
return false;
|
||||
}
|
||||
boolean success = syncReplicas(zkController, core, leaderProps);
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue