Hi Marcel,
> The ReadWriteVersionManager you reference is in oak-jcr, but there is
> also a corresponding class in oak-core, where the actual work is done.

I have made changes in ReadWriteVersionManager of oak-core and raised pr
https://github.com/apache/jackrabbit-oak/pull/688

Explanation: in removeVersion getVersionLabels[1] was called with
versionRelPath (Example :6e/aa/67/6eaa67a8-cf9f-4a78-a991-1a488a3d74a8/1.0
)  and versionId, and
jcr:versionLabels node is present under node
6e/aa/67/6eaa67a8-cf9f-4a78-a991-1a488a3d74a8/ ,so it was returning empty
list of labels. So removeVersionLabel[2] was not called. So versionLabels
was not removed.
Marcel , please let me know if anything I am missing.

Julian, I have added the test case for jackrabbit and raised pr
https://github.com/apache/jackrabbit/pull/127


[1]
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java#L190
[2]
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java#L191




On Tue, Aug 30, 2022 at 1:07 PM Julian Reschke <julian.resc...@gmx.de>
wrote:

> Am 30.08.2022 um 09:28 schrieb Marcel Reutegger:
> > Hi Arun,
> >
> > On 29.08.22, 09:05, "Arun Ram" <arun91i...@gmail.com> wrote:
> >> I have checked the classic jackrabbit . Here i dont see the problem.
> >> In classic jackrabbit InternalVersionHistoryImpl[1] removes the
> >> versionLabel before removing the version.
> >> Also regarding ReferentialIntegrityException of removeVersion , it is
> >> consistent with classic jackrabbit. It is thrown when you remove the
> >> current latest version.
> >
> > Thanks for checking. Then I think Oak should also remove a potential
> > label automatically when a version is removed.
> >
> >> I think changes related to remove the version label should be kept in
> >> ReadWriteVersionManager.java[2] since validation logic for version is
> >> present here.
> >
> > The ReadWriteVersionManager you reference is in oak-jcr, but there is
> > also a corresponding class in oak-core, where the actual work is done.
> >
> > I'd say the following method needs to be changed:
> >
> >
> https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java#L176
> >
> > Regards
> > Marcel
>
> Arun,
>
> would it be possible to add a test that covers this to the
> jackrabbit-jcr test suite?
>
> Best regards, Julian
>
>
>

Reply via email to