Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 19796 invoked from network); 17 Mar 2008 23:50:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Mar 2008 23:50:25 -0000 Received: (qmail 820 invoked by uid 500); 17 Mar 2008 23:50:21 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 801 invoked by uid 500); 17 Mar 2008 23:50:21 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 792 invoked by uid 99); 17 Mar 2008 23:50:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Mar 2008 16:50:21 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Mar 2008 23:49:41 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1JbP5U-0004d7-6s for users@jackrabbit.apache.org; Mon, 17 Mar 2008 16:49:52 -0700 Message-ID: <16108822.post@talk.nabble.com> Date: Mon, 17 Mar 2008 16:49:52 -0700 (PDT) From: Pankaj_Gupta To: users@jackrabbit.apache.org Subject: Datastore garbage collector removes in-use files MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: pankaj.gupta@ansys.com X-Virus-Checked: Checked by ClamAV on apache.org Hi, 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.getWorkspace().getAccessibleWorkspaceNames(); 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, sessionList); 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.