SOLR-14271: Remove duplicate async id check meant for pre Solr 8 versions (#1268)

* SOLR-14271: Remove duplicate async id check meant for pre Solr 8 versions
This commit is contained in:
Anshum Gupta 2020-02-20 15:13:05 -08:00 committed by GitHub
parent cb18586ea0
commit cea4226367
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 36 deletions

View File

@ -28,6 +28,8 @@ Other Changes
* LUCENE-9080: Upgrade ICU4j to 62.2 and make regenerate work (Erick Erickson)
* SOLR-14271: Remove duplicate async id check meant for pre Solr 8 versions (Anshum Gupta)
================== 8.5.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

View File

@ -301,14 +301,6 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
static final Set<String> KNOWN_ROLES = ImmutableSet.of("overseer");
/*
* In SOLR-11739 we change the way the async IDs are checked to decide if one has
* already been used or not. For backward compatibility, we continue to check in the
* old way (meaning, in all the queues) for now. This extra check should be removed
* in Solr 9
*/
private static final boolean CHECK_ASYNC_ID_BACK_COMPAT_LOCATIONS = true;
public static long DEFAULT_COLLECTION_OP_TIMEOUT = 180 * 1000;
public SolrResponse sendToOCPQueue(ZkNodeProps m) throws KeeperException, InterruptedException {
@ -330,14 +322,7 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
NamedList<String> r = new NamedList<>();
if (CHECK_ASYNC_ID_BACK_COMPAT_LOCATIONS && (
coreContainer.getZkController().getOverseerCompletedMap().contains(asyncId) ||
coreContainer.getZkController().getOverseerFailureMap().contains(asyncId) ||
coreContainer.getZkController().getOverseerRunningMap().contains(asyncId) ||
overseerCollectionQueueContains(asyncId))) {
// for back compatibility, check in the old places. This can be removed in Solr 9
r.add("error", "Task with the same requestid already exists.");
} else {
if (coreContainer.getZkController().claimAsyncId(asyncId)) {
boolean success = false;
try {
@ -358,7 +343,6 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
} else {
r.add("error", "Task with the same requestid already exists.");
}
}
r.add(CoreAdminParams.REQUESTID, (String) m.get(ASYNC));
return new OverseerSolrResponse(r);
@ -959,7 +943,7 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
FOLLOW_ALIASES);
return copyPropertiesWithPrefix(req.getParams(), props, COLL_PROP_PREFIX);
}),
OVERSEERSTATUS_OP(OVERSEERSTATUS, (req, rsp, h) -> (Map) new LinkedHashMap<>()),
OVERSEERSTATUS_OP(OVERSEERSTATUS, (req, rsp, h) -> new LinkedHashMap<>()),
/**
* Handle list collection request.
@ -1041,7 +1025,7 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
if (!shardUnique && !SliceMutator.SLICE_UNIQUE_BOOLEAN_PROPERTIES.contains(prop)) {
throw new SolrException(ErrorCode.BAD_REQUEST, "Balancing properties amongst replicas in a slice requires that"
+ " the property be pre-defined as a unique property (e.g. 'preferredLeader') or that 'shardUnique' be set to 'true'. " +
" Property: " + prop + " shardUnique: " + Boolean.toString(shardUnique));
" Property: " + prop + " shardUnique: " + shardUnique);
}
return copy(req.getParams(), map, ONLY_ACTIVE_NODES, SHARD_UNIQUE);
@ -1442,7 +1426,7 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission
}
}
if ((replicaNotAliveCnt == 0) || (replicaNotAliveCnt <= replicaFailCount)) return true;
return (replicaNotAliveCnt == 0) || (replicaNotAliveCnt <= replicaFailCount);
}
return false;
});