Solr
  1. Solr
  2. SOLR-3264

SolrResourceLoader logging about "Solr home set to" is very missleading/broken in multicore

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      the SolrResourceLoader constructor has this bit of logging left over from the days before multicore...

          log.info("Solr home set to '" + this.instanceDir + "'");
      

      but this is confusing and missleading since there are N+1 SOlrResourceLoaders in a given solr instance (1 for the CoreContainer, and N for the N cores) and only one of them is refering to the true "Solr Home" dir, the others are refering to the instanceDir of the respective cores.

      For example, using the 3.5 example and running java -Dsolr.solr.home=multicore -jar start.jar you'll see...

      Mar 21, 2012 7:02:46 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
      INFO: JNDI not configured for solr (NoInitialContextEx)
      Mar 21, 2012 7:02:46 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
      INFO: using system property solr.solr.home: multicore
      Mar 21, 2012 7:02:46 PM org.apache.solr.core.SolrResourceLoader <init>
      INFO: Solr home set to 'multicore/'
      Mar 21, 2012 7:02:46 PM org.apache.solr.servlet.SolrDispatchFilter init
      INFO: SolrDispatchFilter.init()
      Mar 21, 2012 7:02:46 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
      INFO: JNDI not configured for solr (NoInitialContextEx)
      Mar 21, 2012 7:02:46 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
      INFO: using system property solr.solr.home: multicore
      Mar 21, 2012 7:02:46 PM org.apache.solr.core.CoreContainer$Initializer initialize
      INFO: looking for solr.xml: /home/hossman/lucene/lucene-3.5.0_tag/solr/example/multicore/solr.xml
      Mar 21, 2012 7:02:46 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
      INFO: JNDI not configured for solr (NoInitialContextEx)
      Mar 21, 2012 7:02:46 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
      INFO: using system property solr.solr.home: multicore
      Mar 21, 2012 7:02:46 PM org.apache.solr.core.CoreContainer <init>
      INFO: New CoreContainer: solrHome=multicore/ instance=108681753
      Mar 21, 2012 7:02:46 PM org.apache.solr.core.SolrResourceLoader <init>
      INFO: Solr home set to 'multicore/'
      Mar 21, 2012 7:02:46 PM org.apache.solr.core.SolrResourceLoader <init>
      INFO: Solr home set to 'multicore/core0/'
      
      ...lots of logs about initing core0...
      
      INFO: registering core: core0
      Mar 21, 2012 7:02:47 PM org.apache.solr.core.SolrCore registerSearcher
      INFO: [core0] Registered new searcher Searcher@5dde45e2 main
      Mar 21, 2012 7:02:47 PM org.apache.solr.core.SolrResourceLoader <init>
      INFO: Solr home set to 'multicore/core1/'
      Mar 21, 2012 7:02:47 PM org.apache.solr.core.SolrConfig <init>
      
      ...lots of logs about initing core1...
      
      Mar 21, 2012 7:02:47 PM org.apache.solr.core.CoreContainer register
      INFO: registering core: core1
      ...
      

      we should revamp/add some of the log messages from CoreContainer and SolrResourceLoader to make it more clear what the one true solr home is, and when SolrresourceLoader is being used for an instanceDir of a single core.

        Activity

        Hide
        Hoss Man added a comment -

        here's a quick pass at trying to clean this up.

        in addition to pure logging changes (new info lines in CoreContainer about the solrHome and the individual cores being created, and more specific logging in SolrResourceLoader about why it's using the dir it's useing) this also moves arround some of the initialization code in CoreContainer so we don't redundently call locateSolrHome over and over.

        unfortunately there is still double logging from locateSolrHome when using solr.war, because SolrDispatchFilter constructs a little one off Config instance, which constructs a one off SolrResourceInstance. I didn't wnat to try messing with that though since i don't really understand it, and it doesn't really seem to hurt anything (at least all those mentions are truly about hte solr home, not instance dirs being refered to as solr home)

        Show
        Hoss Man added a comment - here's a quick pass at trying to clean this up. in addition to pure logging changes (new info lines in CoreContainer about the solrHome and the individual cores being created, and more specific logging in SolrResourceLoader about why it's using the dir it's useing) this also moves arround some of the initialization code in CoreContainer so we don't redundently call locateSolrHome over and over. unfortunately there is still double logging from locateSolrHome when using solr.war, because SolrDispatchFilter constructs a little one off Config instance, which constructs a one off SolrResourceInstance. I didn't wnat to try messing with that though since i don't really understand it, and it doesn't really seem to hurt anything (at least all those mentions are truly about hte solr home, not instance dirs being refered to as solr home)
        Hide
        Hoss Man added a comment -

        i think it would be good to get this into 3.6

        Show
        Hoss Man added a comment - i think it would be good to get this into 3.6
        Hide
        Mark Miller added a comment -

        +1 - the patch looks good to me.

        Show
        Mark Miller added a comment - +1 - the patch looks good to me.
        Hide
        Hoss Man added a comment -

        Committed revision 1305697. - trunk
        Committed revision 1305703. - 3x

        Show
        Hoss Man added a comment - Committed revision 1305697. - trunk Committed revision 1305703. - 3x

          People

          • Assignee:
            Hoss Man
            Reporter:
            Hoss Man
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development