mkhludnev commented on code in PR #1709: URL: https://github.com/apache/solr/pull/1709#discussion_r1241150249
########## solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java: ########## @@ -555,11 +579,14 @@ public Map<Replica, String> canRemoveReplicas(Collection<Replica> replicas) { replica.getShard().getCollection().getName(), k -> new HashMap<>()) .computeIfAbsent(replica.getShard().getShardName(), k -> new HashSet<>()); replicasRemovedForShard.add(replica); - - if (replicasRemovedForShard.size() - >= getReplicasForShardOnNode(replica.getShard()).size()) { - replicaRemovalExceptions.put( - replica, "co-located with replicas of " + collocatedCollections); + // either if all shards are mandatory, or the current one is mandatory + if (mandatoryShardsOrAll.isEmpty() + || mandatoryShardsOrAll.contains(replica.getShard().getShardName())) { + if (replicasRemovedForShard.size() + >= getReplicasForShardOnNode(replica.getShard()).size()) { + replicaRemovalExceptions.put( Review Comment: ok. I'll add shard name, but replica name already contains a shard name, I suppose. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org