Bug 1306605

Summary: Undeployment of the resource leaves orphaned content data in the RHQ database
Product: [Other] RHQ Project Reporter: bkramer <bkramer>
Component: ContentAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.12CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1306602    
Attachments:
Description Flags
Archive file that contains first_deployment.zip, second_deployment.zip, third_deployment.zip and undeployed_war.zip archives none

Description bkramer 2016-02-11 12:20:58 UTC
Created attachment 1123139 [details]
Archive file that contains first_deployment.zip, second_deployment.zip, third_deployment.zip and undeployed_war.zip archives

Description of problem:
Undeployment of the resource leaves all previously deployed package versions in the database. In a long run, this will fill up the database.

We should remove all content data from the database once relevant resource is undeployed. 


Version-Release number of selected component (if applicable):
RHQ 4.12

How reproducible:
Always

Steps to Reproduce:

1. Deployed memoryleak.war file with package version 1.0 to the EAP server (RHQ UI -> Inventory -> Servers -> EAP -> Inventory -> Create Child -> Deployment) see attached screen shots - first_deployment.zip;
2. Deployed memoryleak.war file with package version 2.0 to the EAP server (RHQ UI -> Inventory -> Servers -> EAP -> Inventory -> Create Child -> Deployment) see attached screen shots - second_deployment.zip;
3. Deployed memoryleak.war file with package version 3.0 to the EAP server (RHQ UI -> Inventory -> Servers -> EAP -> Inventory -> Create Child -> Deployment) see attached screen shots - third_deployment.zip;

4. Undeployed memoryleak.war resource (RHQ UI -> Inventory -> Servers -> EAP -> Inventory -> select "memoryleak.war" resource -> press "Uninventory" button) - as a result rhq_resource table did not contain "memoryleak.war" but rhq_package_version and rhq_package_bits still contained previously deployed content - see undeployed_war.zip



Actual results:
Selected resource was properly deleted (rhq_resource does not contain deleted resource) but rhq_package_version and rhq_package_bits tables still contained all previously deployed content data (undeployed_war.zip)

Expected results:
When resource is undeployed - all its history should be deleted from the database including content data.


Additional info: