mirror of https://github.com/apache/lucene.git
SOLR-10588: Prevent redundant double core reload on config update.
This commit is contained in:
parent
b5e9b5aaf6
commit
cbd3b02cda
|
@ -273,6 +273,8 @@ Bug Fixes
|
|||
|
||||
* SOLR-10316: Unloading a core can remove a ZK SolrCore registration entry for the wrong SolrCore. (Mark Miller)
|
||||
|
||||
* SOLR-10588: Prevent redundant core reload on config update (Mikhail Khludnev)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@ import org.apache.solr.core.snapshots.SolrSnapshotMetaDataManager.SnapshotMetaDa
|
|||
import org.apache.solr.handler.IndexFetcher;
|
||||
import org.apache.solr.handler.ReplicationHandler;
|
||||
import org.apache.solr.handler.RequestHandlerBase;
|
||||
import org.apache.solr.handler.SolrConfigHandler;
|
||||
import org.apache.solr.handler.component.HighlightComponent;
|
||||
import org.apache.solr.handler.component.SearchComponent;
|
||||
import org.apache.solr.logging.MDCLoggingContext;
|
||||
|
@ -2945,10 +2946,19 @@ public final class SolrCore implements SolrInfoBean, SolrMetricProducer, Closeab
|
|||
checkStale(zkClient, solrConfigPath, overlayVersion) ||
|
||||
checkStale(zkClient, managedSchmaResourcePath, managedSchemaVersion)) {
|
||||
log.info("core reload {}", coreName);
|
||||
try {
|
||||
cc.reload(coreName);
|
||||
} catch (SolrCoreState.CoreIsClosedException e) {
|
||||
/*no problem this core is already closed*/
|
||||
SolrConfigHandler configHandler = ((SolrConfigHandler)core.getRequestHandler("/config"));
|
||||
if (configHandler.getReloadLock().tryLock()){
|
||||
|
||||
try {
|
||||
cc.reload(coreName);
|
||||
} catch (SolrCoreState.CoreIsClosedException e) {
|
||||
/*no problem this core is already closed*/
|
||||
} finally {
|
||||
configHandler.getReloadLock().unlock();
|
||||
}
|
||||
|
||||
} else {
|
||||
log.info("Another reload is in progress. Not doing anything.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -104,6 +104,11 @@ public class SolrConfigHandler extends RequestHandlerBase implements SolrCoreAwa
|
|||
public static final boolean configEditing_disabled = Boolean.getBoolean(CONFIGSET_EDITING_DISABLED_ARG);
|
||||
private static final Map<String, SolrConfig.SolrPluginInfo> namedPlugins;
|
||||
private Lock reloadLock = new ReentrantLock(true);
|
||||
|
||||
public Lock getReloadLock() {
|
||||
return reloadLock;
|
||||
}
|
||||
|
||||
private boolean isImmutableConfigSet = false;
|
||||
|
||||
static {
|
||||
|
|
Loading…
Reference in New Issue