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

Creating a core should write a core.properties file first and clean up on failure

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.6.1, 6.7, 7.0, 7.1, master (8.0)
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      I've made the handling of core.properties more consistent as part of the pluggable transient core work. However, a new inconsistency came to light. Most of the code assumes that a core.properties file exists, but it wasn't being persisted until the very end of the coreContainer.create process. So any steps part way through core creation that would manipulate the core.properties file wouldn't find it. And if those steps did make a mistake and call persist on the core.properties, create would fail because the core.properties file would be created. Worse, the transient cache handler had no way of knowing whether the core descriptors being added were from create (where the core.properties file hadn't been created yet) or reload/swap/rename. By moving persisting the core.properties earlier in the create process this would be less trappy.

      Any core.properties file created during this process will be removed if the create fails.

      Cores that are simply being loaded on the other hand do not have their core.properties files removed.

      1. SOLR-11122.patch
        22 kB
        Erick Erickson
      2. SOLR-11122.patch
        22 kB
        Erick Erickson

        Activity

        Hide
        erickerickson Erick Erickson added a comment -

        Patch so far (WiP).

        Along the way I cleaned up some of the code. In particular CoreContainer had two create methods, one strictly internal and one public both called "create". I renamed the private one to createFromDescriptor.

        Also added a getTransientCacheHandler into CoreContainer so it can be easily retrieved from outside.

        Show
        erickerickson Erick Erickson added a comment - Patch so far (WiP). Along the way I cleaned up some of the code. In particular CoreContainer had two create methods, one strictly internal and one public both called "create". I renamed the private one to createFromDescriptor. Also added a getTransientCacheHandler into CoreContainer so it can be easily retrieved from outside.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 4041f8a1c97d9703b5d38b65e842e57cb359da64 in lucene-solr's branch refs/heads/master from Erick Erickson
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4041f8a ]

        SOLR-11122: Creating a core should write a core.properties file first and clean up on failure

        Show
        jira-bot ASF subversion and git services added a comment - Commit 4041f8a1c97d9703b5d38b65e842e57cb359da64 in lucene-solr's branch refs/heads/master from Erick Erickson [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4041f8a ] SOLR-11122 : Creating a core should write a core.properties file first and clean up on failure
        Hide
        erickerickson Erick Erickson added a comment -

        Final patch. The actual code changes are fairly minimal. The meat of the patch is just moving creating the core descriptor earlier in CoreContainer.create and removing it on failure.

        Along the way I found the fact that we had a private create method in CoreContainer that wasn't really related to the public one so I renamed it.

        I also beefed up the tests.

        Show
        erickerickson Erick Erickson added a comment - Final patch. The actual code changes are fairly minimal. The meat of the patch is just moving creating the core descriptor earlier in CoreContainer.create and removing it on failure. Along the way I found the fact that we had a private create method in CoreContainer that wasn't really related to the public one so I renamed it. I also beefed up the tests.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 8e3cbb256fc5f6cccf5f2f8c4427aa85f9b09f2d in lucene-solr's branch refs/heads/branch_7x from Erick Erickson
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8e3cbb2 ]

        SOLR-11122: Creating a core should write a core.properties file first and clean up on failure

        (cherry picked from commit 4041f8a)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 8e3cbb256fc5f6cccf5f2f8c4427aa85f9b09f2d in lucene-solr's branch refs/heads/branch_7x from Erick Erickson [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8e3cbb2 ] SOLR-11122 : Creating a core should write a core.properties file first and clean up on failure (cherry picked from commit 4041f8a)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 4c40a954a846a828a4a7f120d8f51b325f1b3642 in lucene-solr's branch refs/heads/branch_6x from Erick Erickson
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4c40a95 ]

        SOLR-11122: Creating a core should write a core.properties file first and clean up on failure

        Show
        jira-bot ASF subversion and git services added a comment - Commit 4c40a954a846a828a4a7f120d8f51b325f1b3642 in lucene-solr's branch refs/heads/branch_6x from Erick Erickson [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4c40a95 ] SOLR-11122 : Creating a core should write a core.properties file first and clean up on failure
        Hide
        erickerickson Erick Erickson added a comment -

        Yes, this skips 7.0 but it's obscure enough that it's not worth the risk.

        Show
        erickerickson Erick Erickson added a comment - Yes, this skips 7.0 but it's obscure enough that it's not worth the risk.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 2ae77e297a54451a39a407179672123f98024d12 in lucene-solr's branch refs/heads/branch_7_0 from Erick
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2ae77e2 ]

        SOLR-11122: Creating a core should write a core.properties file first and clean up on failure

        (cherry picked from commit 4041f8a1c97d9703b5d38b65e842e57cb359da64)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 2ae77e297a54451a39a407179672123f98024d12 in lucene-solr's branch refs/heads/branch_7_0 from Erick [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2ae77e2 ] SOLR-11122 : Creating a core should write a core.properties file first and clean up on failure (cherry picked from commit 4041f8a1c97d9703b5d38b65e842e57cb359da64)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit ea427f1ac5014d593712a62113add43fe1e28cbb in lucene-solr's branch refs/heads/branch_6_6 from Erick
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ea427f1 ]

        SOLR-11122: Creating a core should write a core.properties file first and clean up on failure

        (cherry picked from commit 4041f8a1c97d9703b5d38b65e842e57cb359da64)

        Show
        jira-bot ASF subversion and git services added a comment - Commit ea427f1ac5014d593712a62113add43fe1e28cbb in lucene-solr's branch refs/heads/branch_6_6 from Erick [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ea427f1 ] SOLR-11122 : Creating a core should write a core.properties file first and clean up on failure (cherry picked from commit 4041f8a1c97d9703b5d38b65e842e57cb359da64)
        Hide
        shalinmangar Shalin Shekhar Mangar added a comment -

        Bulk close after 7.1.0 release

        Show
        shalinmangar Shalin Shekhar Mangar added a comment - Bulk close after 7.1.0 release

          People

          • Assignee:
            erickerickson Erick Erickson
            Reporter:
            erickerickson Erick Erickson
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development