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

Solr JMX MBeans do not survive core reloads

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4, 1.4.1, 3.1, 3.2
    • Fix Version/s: 3.4, 4.0-ALPHA
    • Component/s: multicore
    • Labels:
      None

      Description

      Solr JMX MBeans do not survive core reloads

      "Steps to reproduce"
      sh> cd example
      sh> vi multicore/core0/conf/solrconfig.xml # enable jmx
      sh> java -Dcom.sun.management.jmxremote -Dsolr.solr.home=multicore -jar start.jar
      sh> echo 'open 8842 # 8842 is java pid
      > domain solr/core0
      > beans
      > ' | java -jar jmxterm-1.0-alpha-4-uber.jar
      ....
      solr/core0:id=core0,type=core
      solr/core0:id=org.apache.solr.handler.StandardRequestHandler,type=org.apache.solr.handler.StandardRequestHandler
      solr/core0:id=org.apache.solr.handler.StandardRequestHandler,type=standard
      solr/core0:id=org.apache.solr.handler.XmlUpdateRequestHandler,type=/update
      solr/core0:id=org.apache.solr.handler.XmlUpdateRequestHandler,type=org.apache.solr.handler.XmlUpdateRequestHandler
      ...
      solr/core0:id=org.apache.solr.search.SolrIndexSearcher,type=searcher
      solr/core0:id=org.apache.solr.update.DirectUpdateHandler2,type=updateHandler
      sh> curl 'http://localhost:8983/solr/admin/cores?action=RELOAD&core=core0'
      sh> echo 'open 8842 # 8842 is java pid
      > domain solr/core0
      > beans
      > ' | java -jar jmxterm-1.0-alpha-4-uber.jar
      # there's only one bean left after Solr core reload
      solr/core0:id=org.apache.solr.search.SolrIndexSearcher,type=Searcher@2e831a91 main
      

      The root cause of this is Solr core reload behavior:

      1. create new core (which overwrites existing registered MBeans)
      2. register new core and close old one (we remove/un-register MBeans on oldCore.close)

      The correct sequence is:

      1. unregister MBeans from old core
      2. create and register new core
      3. close old core without touching MBeans

        Attachments

        1. SOLR-2623.patch
          8 kB
          Shalin Shekhar Mangar
        2. SOLR-2623.patch
          8 kB
          Shalin Shekhar Mangar
        3. SOLR-2623.patch
          5 kB
          Alexey Serba
        4. SOLR-2623.patch
          5 kB
          Alexey Serba
        5. SOLR-2623.patch
          4 kB
          Alexey Serba
        6. SOLR-2623-branch3x.patch
          5 kB
          Shalin Shekhar Mangar
        7. SOLR-2623-fixtest-branch_3x.patch
          4 kB
          Shalin Shekhar Mangar
        8. SOLR-2623-testfix-trunk.patch
          8 kB
          Shalin Shekhar Mangar

          Issue Links

            Activity

              People

              • Assignee:
                shalinmangar Shalin Shekhar Mangar
                Reporter:
                alexey Alexey Serba
              • Votes:
                4 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: