You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/02/15 18:24:11 UTC

[GitHub] [lucene-solr] sigram commented on a change in pull request #2373: SOLR-15130: Allow per-collection replica placement node sets

sigram commented on a change in pull request #2373:
URL: https://github.com/apache/lucene-solr/pull/2373#discussion_r576364981



##########
File path: solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
##########
@@ -280,25 +250,31 @@ public void verifyAllowedModification(ModificationRequest modificationRequest, P
 
     private void verifyDeleteCollection(DeleteCollectionRequest deleteCollectionRequest, PlacementContext placementContext) throws PlacementModificationException, InterruptedException {
       Cluster cluster = placementContext.getCluster();
-      Set<String> colocatedCollections = colocatedWith.getOrDefault(deleteCollectionRequest.getCollection().getName(), Set.of());
-      for (String primaryName : colocatedCollections) {
-        try {
-          if (cluster.getCollection(primaryName) != null) {
-            // still exists
-            throw new PlacementModificationException("colocated collection " + primaryName +
-                " of " + deleteCollectionRequest.getCollection().getName() + " still present");
-          }
-        } catch (IOException e) {
-          throw new PlacementModificationException("failed to retrieve colocated collection information", e);
+      Set<String> colocatedWith = new HashSet<>();
+      for (SolrCollection collection : cluster.collections()) {

Review comment:
       That's the most serious downside of keeping this config in collection properties - there's no easy way to keep the reverse mapping up to date. We could try updating the secondary collection... although this would require adding special case code to `OCMH.modifyCollection()`, which breaks the isolation of the plugin from the core.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org