Problems upgrading JMX plugin

Edson Tirelli ed.tirelli at gmail.com
Mon Jul 18 20:16:13 UTC 2011


   Hi,

   Charles asked me to create this thread, so here we go. :)

Background: we have a request to provide an RHQ/JON plugin for Drools [1].
Drools exposes its monitoring stats through standard JMX MBeans (both static
and dynamic). So I created a JMX derived plugin for Drools [2]. During the
development of the plugin (read: creation of the plugin descriptor) I had
problems every time I would make changes to the plugin structure (other than
adding metrics) and trying to redeploy the plugin. Most of the time, it
would "corrupt the database" and I would have to perform a reinstall of the
whole RHQ server. Simply restarting server and agent would not be enough.
Talking to Mazz, he suggested that I nuked the database before redeploying,
and that was what I did, using a fresh install for each test.

Plugin upgrades assumptions: I understand that certain changes might make it
impossible to keep track of history after redeploying a new version of a
given plugin. For instance, one of the things I did was to move a service
that was directly under the server to inside another service. In my
understanding, in such cases, the ideal solution would be for the server to
provide as much access to historical data as possible, but if some data
become unaccessible, it would not be a big deal. BUT it is mandatory that
the server works with the new plugin and start collecting data under the new
structure, without any problems. The same is valid for
adding/removing/renaming operations/metrics/services.

The problem: assuming my understanding of how a plugin upgrade should work
is correct, then there might be a serious problem with the RHQ server or JMX
base plugin. After every change I did during the development of the plugin
(other than adding metrics) followed by a redeploy, the plugin and the
server would stop working. Apparently, some kind of corruption of the
database would occur, preventing the whole server from continuing working
and the only possible solution that I found was to reinstall the whole
server.

Disclaimer: there is one thing I haven't tested: since I was developing the
plugin, the version number remained the same for all the redeploys:

<plugin name="DroolsRHQPlugin"
        ...
        version="1.0"
        ...


I don't know if the RHQ server uses version number as a key for the plugin
data model, what might explain the database corruption.

Configuration used: RHQ 4.0.1, embedded H2 database.

   To reproduce, install RHQ and deploy the Drools plugin [2], collect some
data from a sample application like [3]. Change the plugin by moving a
service around or renaming an operation, etc. Redeploy.

   Thanks,
      Edson

[1] http://www.jboss.org/drools
[2]
https://github.com/droolsjbpm/droolsjbpm-integration/tree/master/drools-rhq-plugin
[3]
https://github.com/droolsjbpm/droolsjbpm-integration/blob/master/droolsjbpm-integration-examples/src/main/java/org/drools/examples/broker/BrokerExample.java

  --
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://fedorahosted.org/pipermail/rhq-devel/attachments/20110718/fe693029/attachment-0001.html 


More information about the rhq-devel mailing list