Github user barrotsteindev commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/528#discussion_r243844755
--- Diff:
solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
---
@@ -1250,23 +1250,10 @@ private UpdateCommand
fetchFullUpdateFromLeader(AddUpdateCommand inplaceAdd, lon
params.set("onlyIfActive", true);
SolrRequest<SimpleSolrResponse> ur = new
GenericSolrRequest(METHOD.GET, "/get", params);
- String leaderUrl = req.getParams().get(DISTRIB_FROM);
-
- if (leaderUrl == null) {
- // An update we're dependent upon didn't arrive! This is unexpected.
Perhaps likely our leader is
- // down or partitioned from us for some reason. Lets force refresh
cluster state, and request the
- // leader for the update.
- if (zkController == null) { // we should be in cloud mode, but wtf?
could be a unit test
- throw new SolrException(ErrorCode.SERVER_ERROR, "Can't find
document with id=" + id + ", but fetching from leader "
- + "failed since we're not in cloud mode.");
- }
- Replica leader;
- try {
- leader =
zkController.getZkStateReader().getLeaderRetry(collection,
cloudDesc.getShardId());
- } catch (InterruptedException e) {
- throw new SolrException(ErrorCode.SERVER_ERROR, "Exception during
fetching from leader.", e);
- }
- leaderUrl = leader.getCoreUrl();
+ String leaderUrl = getLeaderUrl(id);
--- End diff --
Hmmm, if it is crucial to keep the exception message identical,
I could throw the exceptions inside getLeaderUrl(the abstract method).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]