diff --git a/solr/core/src/java/org/apache/solr/core/ConfigSet.java b/solr/core/src/java/org/apache/solr/core/ConfigSet.java index 7161bc1e0ab..7e175592590 100644 --- a/solr/core/src/java/org/apache/solr/core/ConfigSet.java +++ b/solr/core/src/java/org/apache/solr/core/ConfigSet.java @@ -30,7 +30,7 @@ public class ConfigSet { private final String name; private final SolrConfig solrconfig; - private IndexSchema schema; + private volatile IndexSchema schema; private final SchemaSupplier schemaSupplier; diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java index 8ce74d74e10..bcc20399c3f 100644 --- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java +++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java @@ -1589,13 +1589,7 @@ public class CoreContainer { public void reload(String name) { reload(name, null); } - public void reload(String name, UUID coreId, boolean async) { - if(async) { - runAsync(() -> reload(name, coreId)); - } else { - reload(name, coreId); - } - } + /** * Recreates a SolrCore. * While the new core is loading, requests will continue to be dispatched to diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java index 15c8f107c74..2edb926ae1b 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrCore.java +++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java @@ -64,7 +64,6 @@ import com.codahale.metrics.Timer; import com.google.common.collect.Iterators; import com.google.common.collect.MapMaker; import org.apache.commons.io.FileUtils; -import org.apache.lucene.util.ResourceLoader; import org.apache.lucene.codecs.Codec; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexDeletionPolicy; @@ -76,6 +75,7 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.LockObtainFailedException; +import org.apache.lucene.util.ResourceLoader; import org.apache.solr.client.solrj.impl.BinaryResponseParser; import org.apache.solr.cloud.CloudDescriptor; import org.apache.solr.cloud.RecoveryStrategy; @@ -3107,7 +3107,7 @@ public final class SolrCore implements SolrInfoBean, Closeable { if (configHandler.getReloadLock().tryLock()) { try { - cc.reload(coreName, coreId, false); + cc.reload(coreName, coreId); } catch (SolrCoreState.CoreIsClosedException e) { /*no problem this core is already closed*/ } finally { diff --git a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java index 4a1aadb83bd..fc7ca3b6e2e 100644 --- a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java @@ -547,7 +547,7 @@ public class SolrConfigHandler extends RequestHandlerBase implements SolrCoreAwa latestVersion, 30); } else { SolrResourceLoader.persistConfLocally(loader, ConfigOverlay.RESOURCE_NAME, overlay.toByteArray()); - req.getCore().getCoreContainer().reload(req.getCore().getName(), req.getCore().uniqueId, false); + req.getCore().getCoreContainer().reload(req.getCore().getName(), req.getCore().uniqueId); log.info("Executed config commands successfully and persisted to File System {}", ops); } diff --git a/solr/core/src/java/org/apache/solr/schema/SchemaManager.java b/solr/core/src/java/org/apache/solr/schema/SchemaManager.java index c04c9c36c77..f539969403c 100644 --- a/solr/core/src/java/org/apache/solr/schema/SchemaManager.java +++ b/solr/core/src/java/org/apache/solr/schema/SchemaManager.java @@ -132,7 +132,7 @@ public class SchemaManager { latestVersion = ZkController.persistConfigResourceToZooKeeper (zkLoader, managedIndexSchema.getSchemaZkVersion(), managedIndexSchema.getResourceName(), sw.toString().getBytes(StandardCharsets.UTF_8), true); - req.getCore().getCoreContainer().reload(req.getCore().getName(), req.getCore().uniqueId, false); + req.getCore().getCoreContainer().reload(req.getCore().getName(), req.getCore().uniqueId); break; } catch (ZkController.ResourceModifiedInZkException e) { log.info("Schema was modified by another node. Retrying.."); @@ -142,7 +142,7 @@ public class SchemaManager { //only for non cloud stuff managedIndexSchema.persistManagedSchema(false); core.setLatestSchema(managedIndexSchema); - core.getCoreContainer().reload(core.getName(), core.uniqueId, false); + core.getCoreContainer().reload(core.getName(), core.uniqueId); } catch (SolrException e) { log.warn(errorMsg); errors = singletonList(errorMsg + e.getMessage());