Fwd: [Bug 714812] once a Resource is deleted via RHQ, if the underlying managed resource is later recreated and rediscovered by the Agent, it causes an invalid inventory report error in DiscoveryServerServiceImpl & prevents discovery of any new Resources from that Agent

Jay Shaughnessy jshaughn at redhat.com
Wed Nov 2 20:04:53 UTC 2011


Before you do anything please look back at the longish thread about the 
possible removal of the DELETED status (subject: "usage of 
InventoryStatus.DELETED").  I think there is a good argument for getting 
rid of this InventoryStatus completely.

Jay

On 11/2/2011 1:03 PM, Ian Springer wrote:
> Lukas-
>
> I was just looking at this one and thinking a bit about the best way 
> to fix it.
>
> As I recall, when we discussed this briefly at the F2F, it was agreed 
> that the main reason we were leaving DELETED Resources in inventory 
> was so that if the Resource got rediscovered (after the underlying 
> managed resource was recreated), it could be re-attached to its old 
> metric data and other histories.
>
> First on the Server side, there is the below code in 
> DiscoveryBossBean.updatePreviouslyInventoriedResource():
>
>         // If the resource was marked as deleted, reactivate it again.
>         if (existingResource.getInventoryStatus() == 
> InventoryStatus.DELETED) {
>             
> existingResource.setInventoryStatus(InventoryStatus.COMMITTED);
>             
> existingResource.setPluginConfiguration(updatedResource.getPluginConfiguration());
>         }
>
> This has the right idea, but I think it should be changing the status 
> to NEW, not COMMITTED, if it's a platform or a top-level server, since 
> in that case the user should have to import it in order for it to 
> become COMMITTED. The logic would actually be very similar to what we 
> do for newly discovered Resources in initAutoDiscoveredResource(). 
> There is also some other logic in that method we might also want to do 
> like setting the itime to the current time (though I don't know if it 
> makes more sense to leave the itime set to the original pre-DELETED 
> inventory time).
>
> In addition to fixing up the logic in DiscoveryBossBean, I'm guessing 
> there will also be some changes needed to the sync code in 
> InventoryManager on the agent side. For one thing, if a previously 
> DELETED Resource gets rediscovered, we should make sure it ends up 
> having the same uuid and id as the existing Resource on the Server 
> side, so it doesn't end up getting blown away by 
> purgeObsoleteResources(). I haven't done that much thought on the 
> agent side though - it will probably require a bit of experimentation 
> and debugging to figure out what needs to be changed. In any case, I'd 
> fix up DiscoveryBossBeanfirst.
>
> --Ian
>
> -------- Original Message --------
> Subject: 	[Bug 714812] once a Resource is deleted via RHQ, if the 
> underlying managed resource is later recreated and rediscovered by the 
> Agent, it causes an invalid inventory report error in 
> DiscoveryServerServiceImpl & prevents discovery of any new Resources 
> from that Agent
> Date: 	Wed, 2 Nov 2011 12:05:07 -0400
> From: 	bugzilla at redhat.com
> To: 	ian.springer at redhat.com
>
>
>
> Please do not reply directly to this email. All additional
> comments should be made in the comments box of this bug.
>
>
> https://bugzilla.redhat.com/show_bug.cgi?id=714812
>
> Lukas Krejci<lkrejci at redhat.com>  changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>               Status|NEW                         |ASSIGNED
>                   CC|                            |lkrejci at redhat.com
>           AssignedTo|rhq-maint at redhat.com         |lkrejci at redhat.com
>
> -- 
> Configure bugmail:https://bugzilla.redhat.com/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.
>
>
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/rhq-devel


More information about the rhq-devel mailing list