Bug 743305 - initial revision of a Resource's plugin config is not saved to the Resource's plugin config history
Summary: initial revision of a Resource's plugin config is not saved to the Resource's...
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Core Server
Version: 4.1
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-04 14:41 UTC by Ian Springer
Modified: 2024-03-04 13:35 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 743426 0 medium NEW cannot purge latest individual plugin config history item 2022-03-31 04:28:08 UTC

Internal Links: 743426

Description Ian Springer 2011-10-04 14:41:56 UTC
Go to the Inventory > Connection Settings History subtab for a newly imported Resource that has one or more connection settings (i.e. plugin config props). Notice that it is empty, but it should contain one item representing the plugin config initially reported by the plugin discovery component. Now go to the Connection Settings subtab, change the value of a property, then click Save. Go back to the Connection Settings History subtab. Notice that there is one item for the update that you just made, but there is still no item for the initial revision. So there is now no record that there ever was another revision, which is bad for auditing and rollback purposes.

Note, Resource config does not suffer from this issue; we do save the initial revision of Resource configs.

Comment 2 John Mazzitelli 2011-10-05 16:53:33 UTC
this also appears related to bug #743426 (this issue is probably why 743426 happens).

when we fix this, see if it also fixes the "orphaned config" problem that I also just found. if it doesn't, we should fix the orphan problem too.

the orphan problem is the fact that when I uninventory a resource that had a plugin config, the resource is removed, but the row in RHQ_CONFIG (and I think its related properties) are orphaned. They remain in the database but are never referred to again, they just take up space now.

I think this orphan happens here in ConfigurationManagerBean (I added the TODO to show what I think may solve this outside of any fix for this 743305 issue):

    public void completePluginConfigurationUpdate(PluginConfigurationUpdate update) {
        // use EJB3 reference to ourself so that transaction semantics are correct
        ConfigurationUpdateResponse response = configurationManager.executePluginConfigurationUpdate(update);
        Resource resource = update.getResource();

        // link to the newer, persisted configuration object -- regardless of errors
        // TODO: the old plugin configuration is getting orphaned here. I think we need to remove it like this:
        //       entityManager.remove(resource.getPluginConfiguration());
        resource.setPluginConfiguration(update.getConfiguration());


Note You need to log in before you can comment on or make changes to this bug.