Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9533

Reload core config when a core is reloaded

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: 6.2
    • Fix Version/s: 6.3
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      I am reloading a core using coreContainer.reload(coreName). However it doesn't seem to reload the configuration. I have changed solrcore.properties on the file system but the change doesn't get picked up.

      The coreContainer.reload method seems to call:

      CoreDescriptor cd = core.getCoreDescriptor();
      

      I can't see a way to reload CoreDescriptor, so it isn't picking up my changes. It simply reuses the existing CoreDescriptor.

      1. SOLR-9533.patch
        4 kB
        Joel Bernstein
      2. SOLR-9533.patch
        1.0 kB
        Joel Bernstein

        Activity

        Hide
        joel.bernstein Joel Bernstein added a comment -

        I've been reviewing the code around the core reload and it looks like the easiest approach to loading the properties would be the following:

        1) In the SolrCore.reload method create a new CoreDescriptor from the old CoreDescriptor. We can do this easily because there is a constructor in the CoreDescriptor already that takes an existing CoreDescriptor and deep clones it.

        2) Then call CoreDescriptor.loadExtraProperties before passing it to the constructor of the new core.

        I'll put a patch together for this. I'll also investigate the existing test cases for a core reload and see how easy it is to test the properties reload.

        Show
        joel.bernstein Joel Bernstein added a comment - I've been reviewing the code around the core reload and it looks like the easiest approach to loading the properties would be the following: 1) In the SolrCore.reload method create a new CoreDescriptor from the old CoreDescriptor. We can do this easily because there is a constructor in the CoreDescriptor already that takes an existing CoreDescriptor and deep clones it. 2) Then call CoreDescriptor.loadExtraProperties before passing it to the constructor of the new core. I'll put a patch together for this. I'll also investigate the existing test cases for a core reload and see how easy it is to test the properties reload.
        Hide
        mkhludnev Mikhail Khludnev added a comment -

        but it might not be intended to do so https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-RELOAD

        RELOAD performs "live" reloads of SolrCore, reusing some existing objects. Some configuration options, such as the dataDir location and IndexWriter-related settings in solrconfig.xml can not be changed and made active with a simple RELOAD action.

        I'm just concerting that there is some feature behind this limitation

        Show
        mkhludnev Mikhail Khludnev added a comment - but it might not be intended to do so https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-RELOAD RELOAD performs "live" reloads of SolrCore, reusing some existing objects. Some configuration options, such as the dataDir location and IndexWriter-related settings in solrconfig.xml can not be changed and made active with a simple RELOAD action. I'm just concerting that there is some feature behind this limitation
        Hide
        joel.bernstein Joel Bernstein added a comment -

        I think this was more of an oversight to not reload the properties. If you reload the core it would seem that picking up the properties changes would be the right thing to do.

        Show
        joel.bernstein Joel Bernstein added a comment - I think this was more of an oversight to not reload the properties. If you reload the core it would seem that picking up the properties changes would be the right thing to do.
        Hide
        joel.bernstein Joel Bernstein added a comment -

        Small patch that handles the reload.

        This is just for review. If people are ok with this approach I'll work on a test case.

        Show
        joel.bernstein Joel Bernstein added a comment - Small patch that handles the reload. This is just for review. If people are ok with this approach I'll work on a test case.
        Hide
        mkhludnev Mikhail Khludnev added a comment -

        I'm ok with this approach.

        Show
        mkhludnev Mikhail Khludnev added a comment - I'm ok with this approach.
        Hide
        joel.bernstein Joel Bernstein added a comment -

        Added a simple test case

        Show
        joel.bernstein Joel Bernstein added a comment - Added a simple test case
        Hide
        joel.bernstein Joel Bernstein added a comment -

        Ok, thanks!

        Show
        joel.bernstein Joel Bernstein added a comment - Ok, thanks!
        Hide
        joel.bernstein Joel Bernstein added a comment - - edited

        I've been looking for a SolrCloud hook for the solrcore.properties but there does not appear to one. I suspect this is by design as it's called an external properties file in the documentation.

        Show
        joel.bernstein Joel Bernstein added a comment - - edited I've been looking for a SolrCloud hook for the solrcore.properties but there does not appear to one. I suspect this is by design as it's called an external properties file in the documentation.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 2ee723140c5377a4507cdaf5c877d9f0d47d82fc in lucene-solr's branch refs/heads/master from Joel Bernstein
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2ee7231 ]

        SOLR-9533: Reload core config when a core is reloaded

        Show
        jira-bot ASF subversion and git services added a comment - Commit 2ee723140c5377a4507cdaf5c877d9f0d47d82fc in lucene-solr's branch refs/heads/master from Joel Bernstein [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2ee7231 ] SOLR-9533 : Reload core config when a core is reloaded
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit d215f9e5681d7bd570eb3c965402a1010f023942 in lucene-solr's branch refs/heads/master from Joel Bernstein
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d215f9e ]

        SOLR-9533: Fix precommit

        Show
        jira-bot ASF subversion and git services added a comment - Commit d215f9e5681d7bd570eb3c965402a1010f023942 in lucene-solr's branch refs/heads/master from Joel Bernstein [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d215f9e ] SOLR-9533 : Fix precommit
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 9758603b81dfc3cf880bc8d40d5692177b61ae17 in lucene-solr's branch refs/heads/branch_6x from Joel Bernstein
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9758603 ]

        SOLR-9533: Reload core config when a core is reloaded

        Show
        jira-bot ASF subversion and git services added a comment - Commit 9758603b81dfc3cf880bc8d40d5692177b61ae17 in lucene-solr's branch refs/heads/branch_6x from Joel Bernstein [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9758603 ] SOLR-9533 : Reload core config when a core is reloaded
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 0eb62c01b29e13b360b97aa28a991e4b5e694aa7 in lucene-solr's branch refs/heads/branch_6x from Joel Bernstein
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0eb62c0 ]

        SOLR-9533: Fix precommit

        Show
        jira-bot ASF subversion and git services added a comment - Commit 0eb62c01b29e13b360b97aa28a991e4b5e694aa7 in lucene-solr's branch refs/heads/branch_6x from Joel Bernstein [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0eb62c0 ] SOLR-9533 : Fix precommit
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 7b3d29dda77404b9d2772c0df4bc2fd4d600ed5e in lucene-solr's branch refs/heads/master from Joel Bernstein
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=7b3d29d ]

        SOLR-9533, SOLR-9559: Undate CHANGES.txt

        Show
        jira-bot ASF subversion and git services added a comment - Commit 7b3d29dda77404b9d2772c0df4bc2fd4d600ed5e in lucene-solr's branch refs/heads/master from Joel Bernstein [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=7b3d29d ] SOLR-9533 , SOLR-9559 : Undate CHANGES.txt
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 0cadbb995bba0743a201980a7fdc6902dc16c4bc in lucene-solr's branch refs/heads/branch_6x from Joel Bernstein
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0cadbb9 ]

        SOLR-9533, SOLR-9559: Undate CHANGES.txt

        Show
        jira-bot ASF subversion and git services added a comment - Commit 0cadbb995bba0743a201980a7fdc6902dc16c4bc in lucene-solr's branch refs/heads/branch_6x from Joel Bernstein [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0cadbb9 ] SOLR-9533 , SOLR-9559 : Undate CHANGES.txt
        Hide
        shalinmangar Shalin Shekhar Mangar added a comment -

        Closing after 6.3.0 release.

        Show
        shalinmangar Shalin Shekhar Mangar added a comment - Closing after 6.3.0 release.

          People

          • Assignee:
            joel.bernstein Joel Bernstein
            Reporter:
            covolution Gethin James
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development