[ 
https://issues.apache.org/jira/browse/OAK-8048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17212536#comment-17212536
 ] 

Manfred Baedke edited comment on OAK-8048 at 10/12/20, 5:56 PM:
----------------------------------------------------------------

[~mreutegg],

bq. It won't clean the repository up automatically, but there is already an 
existing approach to trigger the logic in OrphanedVersionCleaner. Assuming 
there is an empty version history without a corresponding versionable node. 
Creating a versionable node with a UUID as recorded in the empty version 
history will link the new node to the empty version history. When the node is 
deleted, the OrphanedVersionCleaner will remove the empty version history as 
well.

If we applied this patch, I think we'd have to drop (or tweak) the 
OrphanedVersionCleaner, because it will try to access VersionHistories that 
have already been deleted by the patch code (e.g. 
VersionManagementTest#testRemoveVersion() would fail) and it seems redundant. 

Without the OrphanedVersionCleaner, tests will run fine.

EDIT: even with the patch the OrphanedVersionCleaner is not redundant, because 
it acts on another API level than the VersionManager. In order to get a 
consistent behavior, I'd suggest to change the OrphanedVersionCleaner not to 
fail with an exception if the VersionHistory is already gone.


was (Author: baedke):
[~mreutegg],

bq. It won't clean the repository up automatically, but there is already an 
existing approach to trigger the logic in OrphanedVersionCleaner. Assuming 
there is an empty version history without a corresponding versionable node. 
Creating a versionable node with a UUID as recorded in the empty version 
history will link the new node to the empty version history. When the node is 
deleted, the OrphanedVersionCleaner will remove the empty version history as 
well.

If we applied this patch, I think we'd have to drop (or tweak) the 
OrphanedVersionCleaner, because it will try to access VersionHistories that 
have already been deleted by the patch code (e.g. 
VersionManagementTest#testRemoveVersion() would fail) and it seems redundant. 

Without the OrphanedVersionCleaner, tests will run fine.

> VersionHistory not removed when removing node and all its versions
> ------------------------------------------------------------------
>
>                 Key: OAK-8048
>                 URL: https://issues.apache.org/jira/browse/OAK-8048
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.8.9
>            Reporter: Marco Piovesana
>            Assignee: Manfred Baedke
>            Priority: Major
>         Attachments: OAK-8048-test.diff, OAK-8048.diff, fix-OAK-8048.patch
>
>
> Hi all,
> I'm trying to delete a node and all its versions, but the version history is 
> not removed. I'm doing the following steps (as described in OAK-4370 and 
> JCR-134):
>  # retrieve the version history
>  # delete the node and save the session
>  # delete all versions except for the base version
>  # save the session
> The versions are all gone but the versionHistory node, and the base version 
> node, are still there. Am I doing something wrong? 
> The only test related to this that I found is 
> {{ReadOnlyVersionManagerTest.testRemoveEmptyHistoryAfterRemovingVersionable}}.
>  It does work, but uses Oak related classes and not the JCR interface.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to