jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pankaj_Gupta <pankaj.gu...@ansys.com>
Subject Datastore garbage collector removes in-use files
Date Mon, 17 Mar 2008 23:49:52 GMT


I am using the garbage collection strategy as explained in the DataStore
wiki page but it is not working as expected. Apart from removing unused
files it is also removing files that are still in use. I am using Jackrabbit
1.4.1 with Mysql database and BundleDbPersistenceManager.

I found that the gc.scan() method is not updating the modification time of
all files in the datastore. The behavior is somewhat erratic. The
modification time of a few files is updated when gc starts but other files
are left untouched. When I run gc.scan() and gc.stopScan() repeatedly, then
the modification time of the same set of files is updated again and the rest
are always left untouched. To keep track of the file modification time I am
not calling gc.deleteUnused(). 

To further track this down I downloaded the latest source of
GarbageCollector and created a new instance of it directly. This is shown in
the following listing:
		Credentials creds = 
			new SimpleCredentials("user", "password".toCharArray());
		Session session = rep.login(creds, "root");

		String[] workspaceNames =
		Session[] sessionList = new Session[workspaceNames.length];
		int count = 0;
		for (String ws : workspaceNames) {
			Session s = rep.login(creds, ws);
			sessionList[count++] = s;
		GarbageCollector gc = new GarbageCollector((SessionImpl) session, null,

Now if I call gc.scan() and gc.stopScan() the modification time of all files
is updated as expected.

I thought that maybe the issue is with traversing of nodes with
IterablePersistenceManagers. So I changed  to SimpleDbPersistenceManager.
This would have forced gc to use sessionList for iterating over all nodes.
But when I do this, modification time of no file is updated. This is true
whether I use my own GarbageCollector or the built-in one by calling
session.createDataStoreGarbageCollector(). Through print statements in my
GarbageCollector I can see that all the nodes are getting scanned, but
somehow the file modification time isn't updated.

Any help will be greatly appreciated since without proper cleanup we can't
use the datastore functionality

View this message in context: http://www.nabble.com/Datastore-garbage-collector-removes-in-use-files-tp16108822p16108822.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

View raw message