You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2007/09/17 10:54:32 UTC

[jira] Created: (JCR-1138) Data store garbage collection

Data store garbage collection
-----------------------------

                 Key: JCR-1138
                 URL: https://issues.apache.org/jira/browse/JCR-1138
             Project: Jackrabbit
          Issue Type: Improvement
          Components: core
            Reporter: Thomas Mueller
            Assignee: Thomas Mueller


Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller updated JCR-1138:
--------------------------------

    Comment: was deleted

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1138) Data store garbage collection

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-1138:
-------------------------------

    Priority: Blocker  (was: Major)

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Blocker
>             Fix For: 1.4
>
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Martijn Hendriks (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529319 ] 

Martijn Hendriks commented on JCR-1138:
---------------------------------------

I used the MSSQL bundle PM for the unit tests, and found that the test added last wednesday fails for this PM. For the default derby PM it does not fail. 

testGetAllNodeIds(org.apache.jackrabbit.core.data.PersistenceManagerIteratorTest)  Time elapsed: 0.25 sec  <<< FAILURE!
junit.framework.AssertionFailedError: expected:<-1> but was:<1>
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.failNotEquals(Assert.java:282)
	at junit.framework.Assert.assertEquals(Assert.java:64)
	at junit.framework.Assert.assertEquals(Assert.java:201)
	at junit.framework.Assert.assertEquals(Assert.java:207)
	at org.apache.jackrabbit.core.data.PersistenceManagerIteratorTest.testGetAllNodeIds(PersistenceManagerIteratorTest.java:81)
	at org.apache.jackrabbit.core.data.PersistenceManagerIteratorTest.testGetAllNodeIds(PersistenceManagerIteratorTest.java:81)


> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535652 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

Transient objects are actually removed: when garbage collected.
That's why a WeakReference map is used and not a regular map.
There is no need to write code to remove them.
Or is there a problem with this approach?

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>             Fix For: 1.4
>
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529321 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

Thanks for reporting this! Silly me, I did not follow my own definition of next():
"The order of the node ids is specific for the given persistent manager."
So I can't just assert ascending order of UUIDs...
Still strange that it seems to work with other databases. I will test that.

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529341 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

Hi,

The patch looks good. I tried with PostgreSQL and got this problem:

ConnectionRecoveryManager: could not setup connection, reason: could not load driver: org.postgresql.Driver, state/code: null/0 
(ConnectionRecoveryManager.java, line 430)
ConnectionRecoveryManager: blocking until database connection is up again... 
(ConnectionRecoveryManager.java, line 368)

Do you agree that retry doesn't make sense if the driver could not be loaded? If yes I will change the code. Also, it would probably make sense to write the database URL and the user name (not the password) to the log file, so the person (alias poor guy) who has to start the database knows which one and can test the connection using some other tool.

Thomas

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528000 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

Revision 576314: added a test case and fixed a bug: The garbage collecter deleted too many files when not closing the repository first

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528753 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

Revision 577297: Add AbstractBundlePersistenceManager.getAllNodeIds

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller resolved JCR-1138.
---------------------------------

    Resolution: Fixed

Implemented in revision 604881

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Blocker
>             Fix For: 1.4
>
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552397 ] 

Jukka Zitting commented on JCR-1138:
------------------------------------

What's the status of this issue, i.e. any chance of resolving this soon?

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Blocker
>             Fix For: 1.4
>
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533687 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

Revision 583413: The garbage collection deleted transient objects if the call sequence was:

Session 1: add a blob (still in transient space)
Session 2: start garbage collection
Session 2: garbage collection completed, delete unused objects
Session 1: store the changes

This change adds a WeakReference map to make sure transient objects are not deleted.
A test case is included.


> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>             Fix For: 1.4
>
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528385 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

It does not need to be the insertion order, it can be any order. For BundleFsPersistenceManager the easiest approach would be sort by UUID. For BundleDbPersistenceManager it could be UUID as well, or anything where an index exists. For an in-memory persistence manager HashMap would not always work because the table could be resized. LinkedHashMap would work but not efficiently (you can't get an iterator starting from a certain point). SortedMap would be better (using the tailMap method). 


> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Mueller updated JCR-1138:
--------------------------------

    Comment: was deleted

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552399 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

I will check in my changes today. In my view this item is then resolved.

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Blocker
>             Fix For: 1.4
>
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Pablo Rios (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535670 ] 

Pablo Rios commented on JCR-1138:
---------------------------------

>Or is there a problem with this approach?
No, everything works fine !

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>             Fix For: 1.4
>
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529345 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

If that's OK with you, I will make it throw a RepositoryException if the database driver could not be loaded or initialized (ExceptionInInitializerError):

    private void setupConnection() throws SQLException, RepositoryException {
        try {
            Class driverClass = Class.forName(driver);
            // Workaround for Apache Derby:
            // The JDBC specification recommends the Class.ForName method without the .newInstance() method call, 
            // but adding the newInstance() guarantees that Derby will be booted on any Java Virtual Machine.
            driverClass.newInstance();
        } catch (Throwable e) {
            throw new RepositoryException("Could not load or initialize the database driver class " + driver, e);
        }

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528380 ] 

Marcel Reutegger commented on JCR-1138:
---------------------------------------

> The order of the node ids is specific for the given persistent manager.

Doesn't this mean that an implementation has to retain the order of the bundles it stores? E.g. for a very simple in memory PM you would have to use a LinkedHashMap, because a HashMap doesn't work.

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-1138) Data store garbage collection

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-1138:
-------------------------------

    Fix Version/s: 1.4

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>             Fix For: 1.4
>
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528377 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

To better support garbage collection for the data store, I suggest to add a new method to AbstractBundlePersistenceManager:

    /**
     * Get all node ids. 
     * A typical application will call this method multiple times, where 'after'
     * is the last row read. The maxCount parameter defines the maximum number of 
     * node ids returned, 0 meaning no limit. The order of the node ids is specific for the 
     * given persistent manager. Items that are added concurrently may not be included.
     * 
     * @param after the lower limit, or null for no limit.
     * @param maxCount the maximum number of node ids to return, or 0 for no limit.
     * @return an iterator of all bundles.
     * @throws ItemStateException if an error while loading occurs.
     */
    public abstract NodeIdIterator getAllNodeIds(NodeId after, int maxCount)
            throws ItemStateException;

Only for the Bundle PersistenceManagers, because those persistence managers are the most important ones (in my view).

This method is then called from the garbage collection process (or from a background thread from time to time, with a low maxCount and with enough sleep time in between). After all nodes are processed, the objects in the data store that were never scanned are deleted. This mechanism is better than the current mechanism as it can be restarted: only the last visited node needs to be persisted. It is also more efficient as the persistence manager can return the data in the order it is stored (which is easy for BundleFsPersistenceManager).

What do you think, is this approach OK? 
Thomas

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Pablo Rios (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535639 ] 

Pablo Rios commented on JCR-1138:
---------------------------------

Shouldn't transient objects be removed from the WeakReference map when they are persisted ?
Could this responsibility be added to the AbstractBundlePersistenceManager and called from the store(ChangeLog) method ?


> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>             Fix For: 1.4
>
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12552425 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

With revision 604872, the code to run the data store garbage collection is:

GarbageCollector gc = ((SessionImpl)session).createDataStoreGarbageCollector();
gc.scan();
gc.stopScan();
gc.deleteUnused();

The garbage collector will iterate over all nodes in the repository and update the last modified date. If all persistence managers implement the IterablePersistenceManager interface, this mechanism will be used; if not, the garbage collector will scan the repository using the JCR API starting from the root node.


> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Blocker
>             Fix For: 1.4
>
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-1138) Data store garbage collection

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529332 ] 

Thomas Mueller commented on JCR-1138:
-------------------------------------

Hi Martijn,
If you still have the jcr.log file (usually this is append-only), could you open it and find the place where the test faild with MS SQL Server? The test writes debug info, and I like to check if it really orders the other way. With Derby, I get:

...
 f8425869-0c8f-4e1a-a3e3-d0631d895e34
 f8c06d0c-2233-4e65-bbe3-d5352df9eb93
 072a60c1-0f11-4b96-9dbc-bbe393611869
 16dba3fe-5521-449f-8f35-a4011e5bf3a6
 2093e0c0-d0e8-4282-a0d1-955739278bb8
...

I guess MS SQL Server orders like this:
 072a60c1-0f11-4b96-9dbc-bbe393611869
 16dba3fe-5521-449f-8f35-a4011e5bf3a6
 2093e0c0-d0e8-4282-a0d1-955739278bb8
...
 f8425869-0c8f-4e1a-a3e3-d0631d895e34
 f8c06d0c-2233-4e65-bbe3-d5352df9eb93

Thanks!
Thomas

> Data store garbage collection
> -----------------------------
>
>                 Key: JCR-1138
>                 URL: https://issues.apache.org/jira/browse/JCR-1138
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>
> Currently the data store garbage collection needs to be run manually. It should be simpler to use (maybe tool based), or automatic.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.