Bug 727127

Summary: BRM doesn't clean up when a new repository is imported
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Lukáš Petrovický <lpetrovi>
Component: BRM (Guvnor)Assignee: Jervis Liu <jliu>
Status: CLOSED NOTABUG QA Contact: Lukáš Petrovický <lpetrovi>
Severity: medium Docs Contact:
Priority: low    
Version: BRMS 5.2.0-ER1CC: atangrin, lcarlon, mproctor, trikkola
Target Milestone: ---   
Target Release: BRMS 5.2.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Marked as release note not required as this is an issue between internal builds.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-19 13:36:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Import file for the empty repository none

Description Lukáš Petrovický 2011-08-01 11:20:16 UTC
When a repository is imported in Guvnor, it warns the user that all the data in the old repository will be deleted. This is, however, not true - the data disappear from the GUI, but not from the data store.

This was reproduced with Modeshape on PostgreSQL. It is however the easiest to reproduce with JackRabbit using the default local database. Just import the samples repository, look at the size of the repo on the file system, then import the empty repo (see attached) and look at the size once again.

This is not a problem for JackRabbit as its performance doesn't decrease with increasing the size of the repository. However, it constitutes a problem for Modeshape.

Comment 1 Lukáš Petrovický 2011-08-01 11:20:57 UTC
Created attachment 516116 [details]
Import file for the empty repository

Comment 2 Anne-Louise Tangring 2011-08-12 15:46:59 UTC
Candidate only.

Comment 3 Jervis Liu 2011-08-24 13:49:41 UTC
The repository is indeed cleaned up during import. Below is a detailed jackrabbit repository directory size comparison using empty repository and sample repository:

Step1: Start Guvnor with a brand-new empty repository.

repository: 5.67M
-repository: 128k                               
--datastore:  0                                      
--index:      104k                                 
--meta:       4k                                  
--namespace: 8k                                     
--nodetypes: 12k                                    
-versoin: 1.83m                                   
-workspaces: 3.71M                                
--default: 1.86M                                    
---db: 1.83M                                          
---index: 28K                                         
--security: 1.85M                                

Step2: import sample repo:

repository: 6.17M
-repository: 356k                               
--datastore: 72K                                      
--index:      260k                                 
--meta:       4k                                  
--namespace: 8k                                     
--nodetypes: 12k                                    
-versoin: 1.83m                                   
-workspaces: 3.99M                                
--default: 2.14M                                    
---db: 1.83M                                          
---index: 312K                                         
--security: 1.85M   

Step 3: import empty repo:
repository: 5.93M
-repository: 400k                               
--datastore: 72K                                      
--index:      304k                                 
--meta:       4k                                  
--namespace: 8k                                     
--nodetypes: 12k                                    
-versoin: 1.83m                                   
-workspaces: 3.75M                                
--default: 1.89M                                    
---db: 1.83M                                          
---index: 64K                                         
--security: 1.85M

The only noticeable differences are the size of repository/repository/datastore and repository/repository/index directories. The repository/repository/datastore direcotry is used for large binary properties (eg, compiled drools package binary in our case). So looks like Jackrabbit does not clean these binary files during import. This shall has no impact on performance as these files are not referenced by any nodes anymore. 

The repository/repository/index directory is the Lucene index directory for version story. I am not 100% sure why its size kept increasing. It might be related to https://issues.jboss.org/browse/GUVNOR-296. 

Anyway I am going to close this issue as nothing needs to be changed in Guvnor. Let me know if this is not the case.

Comment 4 Lukáš Petrovický 2011-08-25 05:53:04 UTC
Jervis, would you please try with Modeshape as well? Unless I'm seriously mistaken, the issue will manifest there.

Comment 5 Jervis Liu 2011-08-25 06:07:31 UTC
Hi Lukas, have you got any concrete data with Modeshape to show it does not clean up its repository after an import? As I've verified Guvnor with JackRabbit configuration and there is nothing wrong with either Guvnor or JackRabbit, it is very clear that the problem resides in ModeShape. As long as we've had concrete data to prove this is a problem, we can file an issue against ModeShape directly. We will have to let ModeShape guys to fix this problem.

Comment 6 Lukáš Petrovický 2011-08-25 06:11:28 UTC
Transferring this to ON_QA, I will look into it and try to provide specific data.

Comment 7 lcarlon 2011-09-19 04:40:30 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Marked as release note not required as this is an issue between internal builds.

Comment 8 Lukáš Petrovický 2011-09-19 13:36:45 UTC
Now even I cannot reproduce it. Marking as NOTABUG.