Re-posting as it looks like it did not find its way to the ML. Sorry if
it eventually gets posted twice.
-------- Message original --------
Sujet: Re: Configuration updates on agent
Date : Thu, 03 Jul 2014 16:02:38 +0200
De : Thomas Segismont <tsegismo(a)redhat.com>
Organisation : Red Hat
Pour : rhq-devel(a)lists.fedorahosted.org
Le 03/07/2014 15:35, Jay Shaughnessy a écrit :
We've gone quite a while with it working the way it is so I have
to
think that this AS7 issue is the exception. If that's a correct
assumption then I think any special logic should probably be pushed into
the plugin code. The problem, I think, with not applying the full
configuration is that we can't be sure that the current configuration is
correct. I think we do have to worry about
out-of-band/non-RHQ-inititiated config changes. But this doesn't mean
we couldn't apply only changes.
If the plugin code first did a loadResourceConfiguration to get the
current live config, then diff'ed it with the requested update config,
and applied only the changes, that would be sufficient. Perhaps this is
what you did, I didn't look.
As for resource config diff, we recently talked about having a utility
for this. The UI already does it, and it's not too much code, so this
could/should be made into a general utility and made available to plugins.
Excellent observation. We need to distinguish configuration updates
coming from the UI, in which case we're sure that current configuration
was just loaded, and updates coming from the CLI, where users probably
build a configuration object right in their script.
There's actually another BZ which would benefit from enhancement in this
area:
Bug 1004977 - Datasource configuration changes SHOULD NOT require a
complete reload/restart of EAP
The problem in this case is that users don't want to put their server in
"need reload" state if they only change a property that doesn't require it.
I have not yet started to work on BZ 1004977, but my plan was to add a
'previousConfig' field to the ConfigurationUpdateReport class. Then
plugin developers (not only AS7 plugin developers) could choose
different paths depending on the value of this field:
* if null, apply the config as a whole
* otherwise, make a diff of the config objects and apply as needed
Could you point me at the piece of code in the UI which does the config
diff? I'll check if it can be moved to core-utils.
Thanks
Thomas