mirror of https://github.com/apache/lucene.git
SOLR-7381: Set node name in MDC inside ZkController as soon as we discover it
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1673411 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a64266193a
commit
293efe55c1
|
@ -225,6 +225,8 @@ public final class ZkController {
|
||||||
this.hostName = normalizeHostName(cloudConfig.getHost());
|
this.hostName = normalizeHostName(cloudConfig.getHost());
|
||||||
this.nodeName = generateNodeName(this.hostName, Integer.toString(this.localHostPort), localHostContext);
|
this.nodeName = generateNodeName(this.hostName, Integer.toString(this.localHostPort), localHostContext);
|
||||||
|
|
||||||
|
MDC.put(NODE_NAME_PROP, nodeName);
|
||||||
|
|
||||||
this.leaderVoteWait = cloudConfig.getLeaderVoteWait();
|
this.leaderVoteWait = cloudConfig.getLeaderVoteWait();
|
||||||
this.leaderConflictResolveWait = cloudConfig.getLeaderConflictResolveWait();
|
this.leaderConflictResolveWait = cloudConfig.getLeaderConflictResolveWait();
|
||||||
|
|
||||||
|
|
|
@ -246,9 +246,6 @@ public class CoreContainer {
|
||||||
log.info("Node Name: " + hostName);
|
log.info("Node Name: " + hostName);
|
||||||
|
|
||||||
zkSys.initZooKeeper(this, solrHome, cfg.getCloudConfig());
|
zkSys.initZooKeeper(this, solrHome, cfg.getCloudConfig());
|
||||||
if (isZooKeeperAware()) {
|
|
||||||
MDC.put(NODE_NAME_PROP, getZkController().getNodeName());
|
|
||||||
}
|
|
||||||
|
|
||||||
collectionsHandler = createHandler(cfg.getCollectionsHandlerClass(), CollectionsHandler.class);
|
collectionsHandler = createHandler(cfg.getCollectionsHandlerClass(), CollectionsHandler.class);
|
||||||
containerHandlers.put(COLLECTIONS_HANDLER_PATH, collectionsHandler);
|
containerHandlers.put(COLLECTIONS_HANDLER_PATH, collectionsHandler);
|
||||||
|
|
Loading…
Reference in New Issue