I have a scenario where a repository contains several version nodes that don't reference any mix:versionable
nodes. This is because those versionable nodes have been removed from repository but not their corresponding versions.
This is causing that the JackRabbit Garbage collector cannot remove some files from datastore, because there are versions that still reference them, and consequently the disk space is not properly freed.
I tried to manually remove those versions with the following algorithm:
- Obtain a version by its path, let's say: /jcr:system/jcr:versionStorage/40/05/a9/4005a9b2-51d1-4ed1-8c30-934409e05f86/1.14/jcr:frozenNode
- Get the
jcr:frozenUuid
property from the obtained node - Get the node by identifier, using the frozenUuid from step 2
- If no such node exists, remove the version
But in the last step I get the following exception:
javax.jcr.nodetype.ConstraintViolationException: Unable to perform operation. Node is protected.
So, my question is. How can I remove the version nodes that are unused?
I'm using jackrabbit-2.2.13.