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

Provide a way to know when Core Discovery is finished and when all async cores are done loading

    Details

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

      Description

      Custom transient core implementations could benefit from knowing two things:
      1> that core discovery is over
      2> that all cores that are going to be loaded have been loaded, i.e. all loadOnStartup cores are done.

      It should be trivial to add a method to CoreContainer like "isLoaded" that would answer the first question since you can't get past the load() method without all the cores being discovered. I think this is a more generally useful bit of information than just core discovery is done.

      As for the second, that too seems trivial, just add a method to CoreContainer that returns the number of entries in SolrCores.currentlyLoadingCores.

      I'll add this in a few days unless there are objections.

      1. SOLR-10721.patch
        4 kB
        Erick Erickson
      2. SOLR-10721.patch
        3 kB
        Erick Erickson

        Activity

        Hide
        erickerickson Erick Erickson added a comment -

        Thinking about this a little more, I can envision other kinds of states being added in the future. Rather than calls for various possibilities, what about starting out with just a long and some bit constants? That would give a more nuanced view and wouldn't require that the users know about stuff like "loading is finished, therefore core discovery is finished".

        The fact that setting two bits, call them LOAD_COMPLETED and DISCOVERY_FINISHED at the end of the load() method is an implementation detail.

        Show
        erickerickson Erick Erickson added a comment - Thinking about this a little more, I can envision other kinds of states being added in the future. Rather than calls for various possibilities, what about starting out with just a long and some bit constants? That would give a more nuanced view and wouldn't require that the users know about stuff like "loading is finished, therefore core discovery is finished". The fact that setting two bits, call them LOAD_COMPLETED and DISCOVERY_FINISHED at the end of the load() method is an implementation detail.
        Hide
        erickerickson Erick Erickson added a comment -

        Here's a first cut at a patch for feedback. At this point LOAD_COMPLETE and INITIAL_CORE_LOAD_COMPLETE are set at the same time, I think they're somewhat different concepts and deserve separate flags though one implies the other at this point.

        Show
        erickerickson Erick Erickson added a comment - Here's a first cut at a patch for feedback. At this point LOAD_COMPLETE and INITIAL_CORE_LOAD_COMPLETE are set at the same time, I think they're somewhat different concepts and deserve separate flags though one implies the other at this point.
        Hide
        erickerickson Erick Erickson added a comment -

        Final patch with CHANGES

        Show
        erickerickson Erick Erickson added a comment - Final patch with CHANGES
        Hide
        jira-bot ASF subversion and git services added a comment -

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

        SOLR-10721: Provide a way to know when Core Discovery is finished and when all async cores are done loading

        Show
        jira-bot ASF subversion and git services added a comment - Commit 28b8696d771d6cccdbab673918cbf04d34b998ad in lucene-solr's branch refs/heads/master from Erick [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=28b8696 ] SOLR-10721 : Provide a way to know when Core Discovery is finished and when all async cores are done loading
        Hide
        jira-bot ASF subversion and git services added a comment -

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

        SOLR-10721: Provide a way to know when Core Discovery is finished and when all async cores are done loading

        (cherry picked from commit 28b8696)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 6f7bfb201615e77c7d67555108f510f634bbab9f in lucene-solr's branch refs/heads/branch_6x from Erick [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6f7bfb2 ] SOLR-10721 : Provide a way to know when Core Discovery is finished and when all async cores are done loading (cherry picked from commit 28b8696)
        Hide
        jira-bot ASF subversion and git services added a comment -

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

        SOLR-10721:Provide a way to know when Core Discovery is finished and when all async cores are done loading, resolving merge confilct

        Show
        jira-bot ASF subversion and git services added a comment - Commit 8f750744fde6a04b8e13bf8c31d04fd450f22f2b in lucene-solr's branch refs/heads/branch_6x from Erick [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8f75074 ] SOLR-10721 :Provide a way to know when Core Discovery is finished and when all async cores are done loading, resolving merge confilct
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 02c1b75d44ecd4d17a71fe48978b79bc04d872be 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=02c1b75 ]

        SOLR-10721: Provide a way to know when Core Discovery is finished and when all async cores are done loading

        Show
        jira-bot ASF subversion and git services added a comment - Commit 02c1b75d44ecd4d17a71fe48978b79bc04d872be 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=02c1b75 ] SOLR-10721 : Provide a way to know when Core Discovery is finished and when all async cores are done loading

          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