SOLR-14151: cleanup

This commit is contained in:
noble 2020-09-29 15:37:47 +10:00
parent 01da67c728
commit a65e9dd311
5 changed files with 7 additions and 13 deletions

View File

@ -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;

View File

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

View File

@ -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 {

View File

@ -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);
}

View File

@ -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());