Solr
  1. Solr
  2. SOLR-5281

Incorrect access core.properties in IndexSchema.java

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.5
    • Fix Version/s: 4.5, 4.6, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      IndexSchema use core name for logging.
      But core name always output "[null] Schema..", the following.


      "3814 [coreLoadExecutor-3-thread-1] INFO org.apache.solr.schema.IndexSchema – Reading Solr Schema from schema.xml
      3926 [coreLoadExecutor-3-thread-1] INFO org.apache.solr.schema.IndexSchema – [null] Schema name=example

      Maybe, property name pattern changed "name" to "solr.core.name" at SOLR-5162.

      — IndexSchema.java
      ...
      public static final String NAME = "name";
      ...
      if (loader.getCoreProperties() != null)

      { sb.append(loader.getCoreProperties().getProperty(NAME)); }

      else

      { sb.append("null"); }

        Activity

        Hide
        Steve Rowe added a comment -

        I can confirm that this is a regression. I ran the example in both 4.4 and 4.5:

        4.4:

        1995 [coreLoadExecutor-3-thread-1] INFO  org.apache.solr.schema.IndexSchema  – [collection1] Schema name=example
        

        4.5:

        1939 [coreLoadExecutor-3-thread-1] INFO  org.apache.solr.schema.IndexSchema  – [null] Schema name=example
        
        Show
        Steve Rowe added a comment - I can confirm that this is a regression. I ran the example in both 4.4 and 4.5: 4.4: 1995 [coreLoadExecutor-3-thread-1] INFO org.apache.solr.schema.IndexSchema – [collection1] Schema name=example 4.5: 1939 [coreLoadExecutor-3-thread-1] INFO org.apache.solr.schema.IndexSchema – [null] Schema name=example
        Hide
        Steve Rowe added a comment -

        Debugging 4.5, at the point in IndexSchema.java that Jun gave in the description, loader.coreProperties has:

        {
          solr.core.config=solrconfig.xml, 
          absoluteInstDir=/Users/sarowe/svn/lucene/dev/branches/lucene_solr_4_5/solr/example/solr/collection1/, 
          solr.core.schema=schema.xml, 
          solr.core.transient=false, 
          solr.core.instanceDir=/Users/sarowe/svn/lucene/dev/branches/lucene_solr_4_5/solr/example/solr/collection1, 
          solr.core.dataDir=data/, 
          solr.core.loadOnStartup=true, 
          solr.core.name=collection1
        } 
        

        So Jun's analysis appears to be correct: coreProperties no longer contains "name", but rather "solr.core.name".

        Show
        Steve Rowe added a comment - Debugging 4.5, at the point in IndexSchema.java that Jun gave in the description, loader.coreProperties has: { solr.core.config=solrconfig.xml, absoluteInstDir=/Users/sarowe/svn/lucene/dev/branches/lucene_solr_4_5/solr/example/solr/collection1/, solr.core.schema=schema.xml, solr.core.transient=false, solr.core.instanceDir=/Users/sarowe/svn/lucene/dev/branches/lucene_solr_4_5/solr/example/solr/collection1, solr.core.dataDir=data/, solr.core.loadOnStartup=true, solr.core.name=collection1 } So Jun's analysis appears to be correct: coreProperties no longer contains "name", but rather "solr.core.name".
        Hide
        Steve Rowe added a comment -

        Trivial patch against trunk. I applied this to the lucene_solr_4_5 branch and the core name shows up in the log message instead of null. Committing shortly.

        Show
        Steve Rowe added a comment - Trivial patch against trunk. I applied this to the lucene_solr_4_5 branch and the core name shows up in the log message instead of null. Committing shortly.
        Hide
        Shawn Heisey added a comment -

        This is the problem that I had noticed and was looking into further when I stumbled onto SOLR-5279.

        Show
        Shawn Heisey added a comment - This is the problem that I had noticed and was looking into further when I stumbled onto SOLR-5279 .
        Hide
        ASF subversion and git services added a comment -

        Commit 1526972 from Steve Rowe in branch 'dev/trunk'
        [ https://svn.apache.org/r1526972 ]

        SOLR-5281: IndexSchema log message was printing '[null]' instead of '[<core name>]'

        Show
        ASF subversion and git services added a comment - Commit 1526972 from Steve Rowe in branch 'dev/trunk' [ https://svn.apache.org/r1526972 ] SOLR-5281 : IndexSchema log message was printing ' [null] ' instead of ' [<core name>] '
        Hide
        ASF subversion and git services added a comment -

        Commit 1526973 from Steve Rowe in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1526973 ]

        SOLR-5281: IndexSchema log message was printing '[null]' instead of '[<core name>]' (merge trunk r1526972)

        Show
        ASF subversion and git services added a comment - Commit 1526973 from Steve Rowe in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1526973 ] SOLR-5281 : IndexSchema log message was printing ' [null] ' instead of ' [<core name>] ' (merge trunk r1526972)
        Hide
        Steve Rowe added a comment -

        Committed to trunk and branch_4x.

        Thanks Jun!

        Show
        Steve Rowe added a comment - Committed to trunk and branch_4x. Thanks Jun!
        Hide
        Steve Rowe added a comment -

        FYI, I looked and didn't find any other references to the implicit core "name" property accessed via SolrResourceLoader's coreProperties or getCoreProperties().

        Show
        Steve Rowe added a comment - FYI, I looked and didn't find any other references to the implicit core "name" property accessed via SolrResourceLoader 's coreProperties or getCoreProperties() .
        Hide
        ASF subversion and git services added a comment -

        Commit 1527074 from Steve Rowe in branch 'dev/trunk'
        [ https://svn.apache.org/r1527074 ]

        SOLR-5281: Move CHANGES.txt entry from 4.6 to 4.5

        Show
        ASF subversion and git services added a comment - Commit 1527074 from Steve Rowe in branch 'dev/trunk' [ https://svn.apache.org/r1527074 ] SOLR-5281 : Move CHANGES.txt entry from 4.6 to 4.5
        Hide
        ASF subversion and git services added a comment -

        Commit 1527075 from Steve Rowe in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1527075 ]

        SOLR-5281: Move CHANGES.txt entry from 4.6 to 4.5 (merged trunk r1527074)

        Show
        ASF subversion and git services added a comment - Commit 1527075 from Steve Rowe in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1527075 ] SOLR-5281 : Move CHANGES.txt entry from 4.6 to 4.5 (merged trunk r1527074)
        Hide
        ASF subversion and git services added a comment -

        Commit 1527080 from Steve Rowe in branch 'dev/branches/lucene_solr_4_5'
        [ https://svn.apache.org/r1527080 ]

        SOLR-5281: IndexSchema log message was printing '[null]' instead of '[<core name>]' (merge trunk r1526972 and 1527074)

        Show
        ASF subversion and git services added a comment - Commit 1527080 from Steve Rowe in branch 'dev/branches/lucene_solr_4_5' [ https://svn.apache.org/r1527080 ] SOLR-5281 : IndexSchema log message was printing ' [null] ' instead of ' [<core name>] ' (merge trunk r1526972 and 1527074)
        Hide
        Adrien Grand added a comment -

        4.5 release -> bulk close

        Show
        Adrien Grand added a comment - 4.5 release -> bulk close

          People

          • Assignee:
            Steve Rowe
            Reporter:
            Jun Ohtani
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development