Bug 1306602 - Uninventory of resource leaves orphaned content data in the database
Uninventory of resource leaves orphaned content data in the database
Status: CLOSED ERRATA
Product: JBoss Operations Network
Classification: JBoss
Component: Content (Show other bugs)
JON 3.3.5
Unspecified Unspecified
high Severity high
: ER01
: JON 3.3.6
Assigned To: Ruben Vargas Palma
Filip Brychta
: Triaged
Depends On: 1306605
Blocks: 1381720
  Show dependency treegraph
 
Reported: 2016-02-11 07:17 EST by bkramer
Modified: 2016-10-04 15:57 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-27 11:32:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Archive file that contains first_deployment.zip, second_deployment.zip, third_deployment.zip and undeployed_war.zip archives (1.11 MB, application/zip)
2016-02-11 07:17 EST, bkramer
no flags Details
Screenshot - removed_war.png (288.14 KB, image/png)
2016-02-11 09:33 EST, bkramer
no flags Details

  None (edit)
Description bkramer 2016-02-11 07:17:05 EST
Created attachment 1123135 [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):
JBoss ON 3.3.5

How reproducible:
Always

Steps to Reproduce:

1. Deployed memoryleak.war file with package version 1.0 to the EAP server (JBoss ON 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 (JBoss ON 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 (JBoss ON UI -> Inventory -> Servers -> EAP -> Inventory -> Create Child -> Deployment) see attached screen shots - third_deployment.zip;

****** rhq_resource contains one "memoryleak.war" record, rhq_package_version - 4 records and rhq_package_bits - 3.

4. Undeployed memoryleak.war resource (JBoss ON 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:
Comment 1 Larry O'Leary 2016-02-11 09:02:49 EST
> 4. Undeployed memoryleak.war resource (JBoss ON 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

I think "undeploy" can make this confusing. For clarity, the procedure done in step 4. DOES NOT "undeploy" the WAR. It only removes the resource from inventory. If the WAR is still deployed to the EAP server, it will get rediscovered.

To confirm that this is an actual bug, please remove the WAR from the EAP server -- without using JBoss ON -- before step 4.
Comment 2 bkramer 2016-02-11 09:33:05 EST
(In reply to Larry O'Leary from comment #1)
> > 4. Undeployed memoryleak.war resource (JBoss ON 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
> 
> I think "undeploy" can make this confusing. For clarity, the procedure done
> in step 4. DOES NOT "undeploy" the WAR. It only removes the resource from
> inventory. If the WAR is still deployed to the EAP server, it will get
> rediscovered.
> 
> To confirm that this is an actual bug, please remove the WAR from the EAP
> server -- without using JBoss ON -- before step 4.

Larry, my mistake - I did remove war file from EAP first (using EAP Management Console), and then uninventoried it from JBoss ON UI. I just forgot to mention that. 

So, this is what I did:

***********************
1. Deployed memoryleak.war file with package version 1.0 to the EAP server (JBoss ON 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 (JBoss ON 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 (JBoss ON UI -> Inventory -> Servers -> EAP -> Inventory -> Create Child -> Deployment) see attached screen shots - third_deployment.zip;

4. Navigated to EAP management console -> Deployments ->  selected "memoryleak.war" deployment -> click "Remove" button -see attached removed_war.png;

5. Undeployed memoryleak.war resource (JBoss ON 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
***********************
Comment 3 bkramer 2016-02-11 09:33 EST
Created attachment 1123165 [details]
Screenshot - removed_war.png
Comment 6 Ruben Vargas Palma 2016-06-23 09:41:44 EDT
commit d94e18d1be7b23ed001a3e106bd5051e68f3685f
Merge: bfbc8f3 2f8a95a
Author: Michael Burman <yak@iki.fi>
Date:   Tue Jun 21 15:22:24 2016 +0300

    Merge pull request #247 from rubenvp8510/Bug/1306602
    
    Bug 1306602 - Uninventory of resource leaves orphaned content data in…


commit 2f8a95aceef6ae316be0a574e94616b6daf77587                                                                                                                                                                                              
Author: Ruben Vargas <rvargasp@redhat.com>                                                                                                                                                                                                   
Date:   Thu Apr 28 23:14:57 2016 -0500                                                                                                                                                                                                       
                                                                                                                                                                                                                                             
    Bug 1306602 - Uninventory of resource leaves orphaned content data in the database
Comment 8 Simeon Pinder 2016-07-07 04:22:39 EDT
Moving to ON_QA as available to test with the following build:
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=502442

Note: 	jon-server-patch-3.3.0.GA.zip maps to JON 3.3.6(jon-server-3.3.0.GA-update-06.zip)
Comment 10 errata-xmlrpc 2016-07-27 11:32:39 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-1519.html

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