Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-10756: Undeprecate ZkStateReader.updateClusterState(), mark as @lucene.internal, and rename to forciblyRefreshAllClusterStateSlow().

Steve Rowe68623e975c7b
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 9c1a5d12118..d572cdd50b9 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -575,6 +575,9 @@ Other Changes
* SOLR-11155: /analysis/field and /analysis/document requests should support points fields.
(Jason Gerlowski, Steve Rowe)
+
+* SOLR-10756: Undeprecate ZkStateReader.updateClusterState(), mark as @lucene.internal, and rename to
+ forciblyRefreshAllClusterStateSlow().
================== 6.7.0 ==================
diff --git a/solr/core/src/java/org/apache/solr/cloud/Overseer.java b/solr/core/src/java/org/apache/solr/cloud/Overseer.java
index 521434af546..7dd85bc8446 100644
--- a/solr/core/src/java/org/apache/solr/cloud/Overseer.java
+++ b/solr/core/src/java/org/apache/solr/cloud/Overseer.java
@@ -142,7 +142,7 @@ public class Overseer implements Closeable {
//TODO consider removing 'refreshClusterState' and simply check if clusterState is null
if (refreshClusterState) {
try {
- reader.updateClusterState();
+ reader.forciblyRefreshAllClusterStateSlow();
clusterState = reader.getClusterState();
zkStateWriter = new ZkStateWriter(reader, stats);
refreshClusterState = false;
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java b/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java
index f66f8925737..864172082df 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestTolerantUpdateProcessorCloud.java
@@ -132,7 +132,7 @@ public class TestTolerantUpdateProcessorCloud extends SolrCloudTestCase {
String nodeKey = jettyURL.getHost() + ":" + jettyURL.getPort() + jettyURL.getPath().replace("/","_");
urlMap.put(nodeKey, jettyURL.toString());
}
- zkStateReader.updateClusterState();
+ zkStateReader.forceUpdateCollection(COLLECTION_NAME);
ClusterState clusterState = zkStateReader.getClusterState();
for (Slice slice : clusterState.getSlices(COLLECTION_NAME)) {
String shardName = slice.getName();
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.java
index 1b035347993..c01f15b26bd 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
@@ -261,10 +261,11 @@ public class ZkStateReader implements Closeable {
/**
* Forcibly refresh cluster state from ZK. Do this only to avoid race conditions because it's expensive.
*
- * @deprecated Don't call this, call {@link #forceUpdateCollection(String)} on a single collection if you must.
+ * It is cheaper to call {@link #forceUpdateCollection(String)} on a single collection if you must.
+ *
+ * @lucene.internal
*/
- @Deprecated
- public void updateClusterState() throws KeeperException, InterruptedException {
+ public void forciblyRefreshAllClusterStateSlow() throws KeeperException, InterruptedException {
synchronized (getUpdateLock()) {
if (clusterState == null) {
// Never initialized, just run normal initialization.