Apache Solr open-source search software
SOLR-8323: Handle removal of legacy collections
Alan Woodwardc0d23a741e9f
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.javaindex 7c6b244d95e..fe04d35e148 100644--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java@@ -519,7 +519,8 @@ public class ZkStateReader implements Closeable {continue;// legacy collections are always in-memoryDocCollection oldState = ref.get();- DocCollection newState = loadedData.getCollectionStates().get(coll).get();+ ClusterState.CollectionRef newRef = loadedData.getCollectionStates().get(coll);+ DocCollection newState = newRef == null ? null : newRef.get();if (!collWatch.stateWatchers.isEmpty()&& !Objects.equals(oldState, newState)) {notifyStateWatchers(liveNodes, coll, newState);