Bug 1018026

Summary: (6.4.0)Fail to remove the content file from the domain/servers/serverName/data/content folder when undeploying application from a stopped server.
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Daniel Wang <zhanwang>
Component: Domain ManagementAssignee: Emmanuel Hugonnet (ehsavoie) <ehugonne>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.1.0CC: bbaranow, bmaxwell, brian.stansberry, dandread, joallen, kkhan, mepley, nobody, wili
Target Milestone: DR11   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Deployments are removed from the content repository as part of management operations that remove them from the configuration. But, if a server in a managed domain is stopped when those management operations occur, the content will not be removed from that server's repository. Consequence: Deployment content for deployment archives that are no longer used in the domain can accumulate in individual servers' content repository, wasting disk space. Fix: EAP now periodically runs a background process that checks for and removes content in the repository that is not referenced in the configuration model. Result: If an archive has been removed from the domain while a server that has a copy of it is offline remains, the garbage collection protocol will remove it within 5 to 10 minutes of the server being started.
Story Points: ---
Clone Of:
: 1163634 (view as bug list) 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: 1163634    

Description Daniel Wang 2013-10-11 03:05:14 UTC
Description of problem:
The subfolder located in domain/servers/serverName/data/content cannot be removed when undeploying the application from a stopped server.

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


How reproducible:


Steps to Reproduce:
1. Start EAP 6 as domain mode.
1.1 <EAP6>/bin/domain.xml
2. Using JBOSS CLI to connect to the EAP6. 
2.1 <EAP6>/bin/jboss_cli.sh --connect
3. deploy one application to main-server-group via JBOSS CLI. After this, there is a new subfolder will be created in the directory domain/servers/serverName/data/content.
3.1 CLI> deploy /path/to/XX.ear --server-groups=main-server-group
4. stop the main-server-group
4.1 CLI> /server-group=main-server-group:stop-servers
5. undeploy the application. 
5.1 CLI> undeploy XX.ear --server-groups=main-server-group
6. start the main-server-group

Actual results:
It displays JBAS014901: Content removed from location domain/servers/serverName/data/content in log. But the subfolder related to the XX.ear doesn't be removed from the content folder.


Expected results:
The subfolder related to the XX.ear could be removed from the content folder.


Additional info:
This issue could be reproduced in EAP6.1.0 GA.

Comment 2 James Livingston 2014-08-01 00:21:00 UTC
*** Bug 1124689 has been marked as a duplicate of this bug. ***

Comment 3 James Livingston 2014-08-01 03:25:37 UTC
Bug 1029851 is about a similar problem caused by cancelling the second step of the web UI, which will hopefully be resolved by switching to a single-step UI.

Comment 5 JBoss JIRA Server 2014-09-23 14:09:13 UTC
Emmanuel Hugonnet <ehugonne> updated the status of jira WFLY-122 to Coding In Progress

Comment 6 Emmanuel Hugonnet (ehsavoie) 2014-11-19 07:15:51 UTC
PR : https://github.com/jbossas/jboss-eap/pull/1969
Upstream : https://github.com/wildfly/wildfly-core/pull/284

Comment 7 Petr Kremensky 2014-11-26 13:28:56 UTC
This doesn't work for me (6.4.0.DR11):

./domain.sh 
./jboss-cli.sh -c
[domain@localhost:9999 /] deploy test.war --server-groups=main-server-group
[domain@localhost:9999 /] /server-group=main-server-group:stop-servers
[domain@localhost:9999 /] undeploy test.war --server-groups=main-server-group
[domain@localhost:9999 /] /server-group=main-server-group:start-servers

find . -name content
./data/content
./servers/server-two/data/content
./servers/server-two/data/content/ed/1e8553c719acbc0976d74fc93ea8e51b769171/content
./servers/server-one/data/content
./servers/server-one/data/content/ed/1e8553c719acbc0976d74fc93ea8e51b769171/content

content files from domain/servers/server-*/data/content are still not removed

Comment 8 Emmanuel Hugonnet (ehsavoie) 2014-11-26 13:36:50 UTC
How long did you wait ?

Comment 9 Petr Kremensky 2014-11-26 14:33:10 UTC
Verifying the issue after chat with Emmanuel.

EAP triggers :clean-obsolete-content() every 5 minutes. All unused content is marked as obsolete on first run, all marked stuff is removed on second run.

Verified on EAP 6.4.0.DR11