mirror of https://github.com/apache/lucene.git
SOLR-14750: use core id to avoid duplicate core reloads
This commit is contained in:
parent
c9c75810c2
commit
1c8f4c988a
|
@ -3060,6 +3060,7 @@ public final class SolrCore implements SolrInfoBean, Closeable {
|
||||||
|
|
||||||
public static Runnable getConfListener(SolrCore core, ZkSolrResourceLoader zkSolrResourceLoader) {
|
public static Runnable getConfListener(SolrCore core, ZkSolrResourceLoader zkSolrResourceLoader) {
|
||||||
final String coreName = core.getName();
|
final String coreName = core.getName();
|
||||||
|
final UUID coreId = core.uniqueId;
|
||||||
final CoreContainer cc = core.getCoreContainer();
|
final CoreContainer cc = core.getCoreContainer();
|
||||||
final String overlayPath = zkSolrResourceLoader.getConfigSetZkPath() + "/" + ConfigOverlay.RESOURCE_NAME;
|
final String overlayPath = zkSolrResourceLoader.getConfigSetZkPath() + "/" + ConfigOverlay.RESOURCE_NAME;
|
||||||
final String solrConfigPath = zkSolrResourceLoader.getConfigSetZkPath() + "/" + core.getSolrConfig().getName();
|
final String solrConfigPath = zkSolrResourceLoader.getConfigSetZkPath() + "/" + core.getSolrConfig().getName();
|
||||||
|
@ -3095,7 +3096,7 @@ public final class SolrCore implements SolrInfoBean, Closeable {
|
||||||
if (configHandler.getReloadLock().tryLock()) {
|
if (configHandler.getReloadLock().tryLock()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cc.reload(coreName);
|
cc.reload(coreName, coreId);
|
||||||
} catch (SolrCoreState.CoreIsClosedException e) {
|
} catch (SolrCoreState.CoreIsClosedException e) {
|
||||||
/*no problem this core is already closed*/
|
/*no problem this core is already closed*/
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -547,7 +547,7 @@ public class SolrConfigHandler extends RequestHandlerBase implements SolrCoreAwa
|
||||||
latestVersion, 30);
|
latestVersion, 30);
|
||||||
} else {
|
} else {
|
||||||
SolrResourceLoader.persistConfLocally(loader, ConfigOverlay.RESOURCE_NAME, overlay.toByteArray());
|
SolrResourceLoader.persistConfLocally(loader, ConfigOverlay.RESOURCE_NAME, overlay.toByteArray());
|
||||||
req.getCore().getCoreContainer().reload(req.getCore().getName());
|
req.getCore().getCoreContainer().reload(req.getCore().getName(), req.getCore().uniqueId);
|
||||||
log.info("Executed config commands successfully and persisted to File System {}", ops);
|
log.info("Executed config commands successfully and persisted to File System {}", ops);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ public class SchemaManager {
|
||||||
latestVersion = ZkController.persistConfigResourceToZooKeeper
|
latestVersion = ZkController.persistConfigResourceToZooKeeper
|
||||||
(zkLoader, managedIndexSchema.getSchemaZkVersion(), managedIndexSchema.getResourceName(),
|
(zkLoader, managedIndexSchema.getSchemaZkVersion(), managedIndexSchema.getResourceName(),
|
||||||
sw.toString().getBytes(StandardCharsets.UTF_8), true);
|
sw.toString().getBytes(StandardCharsets.UTF_8), true);
|
||||||
req.getCore().getCoreContainer().reload(req.getCore().getName());
|
req.getCore().getCoreContainer().reload(req.getCore().getName(), req.getCore().uniqueId);
|
||||||
break;
|
break;
|
||||||
} catch (ZkController.ResourceModifiedInZkException e) {
|
} catch (ZkController.ResourceModifiedInZkException e) {
|
||||||
log.info("Schema was modified by another node. Retrying..");
|
log.info("Schema was modified by another node. Retrying..");
|
||||||
|
@ -142,7 +142,7 @@ public class SchemaManager {
|
||||||
//only for non cloud stuff
|
//only for non cloud stuff
|
||||||
managedIndexSchema.persistManagedSchema(false);
|
managedIndexSchema.persistManagedSchema(false);
|
||||||
core.setLatestSchema(managedIndexSchema);
|
core.setLatestSchema(managedIndexSchema);
|
||||||
core.getCoreContainer().reload(core.getName());
|
core.getCoreContainer().reload(core.getName(), core.uniqueId);
|
||||||
} catch (SolrException e) {
|
} catch (SolrException e) {
|
||||||
log.warn(errorMsg);
|
log.warn(errorMsg);
|
||||||
errors = singletonList(errorMsg + e.getMessage());
|
errors = singletonList(errorMsg + e.getMessage());
|
||||||
|
|
Loading…
Reference in New Issue