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:
Shalin Shekhar Mangar 2015-04-14 11:45:20 +00:00
parent a64266193a
commit 293efe55c1
2 changed files with 2 additions and 3 deletions

View File

@ -225,6 +225,8 @@ public final class ZkController {
this.hostName = normalizeHostName(cloudConfig.getHost());
this.nodeName = generateNodeName(this.hostName, Integer.toString(this.localHostPort), localHostContext);
MDC.put(NODE_NAME_PROP, nodeName);
this.leaderVoteWait = cloudConfig.getLeaderVoteWait();
this.leaderConflictResolveWait = cloudConfig.getLeaderConflictResolveWait();

View File

@ -246,9 +246,6 @@ public class CoreContainer {
log.info("Node Name: " + hostName);
zkSys.initZooKeeper(this, solrHome, cfg.getCloudConfig());
if (isZooKeeperAware()) {
MDC.put(NODE_NAME_PROP, getZkController().getNodeName());
}
collectionsHandler = createHandler(cfg.getCollectionsHandlerClass(), CollectionsHandler.class);
containerHandlers.put(COLLECTIONS_HANDLER_PATH, collectionsHandler);