[
https://issues.apache.org/jira/browse/OAK-10812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17869911#comment-17869911
]
Ionut Pirlogea commented on OAK-10812:
--------------------------------------
Hi [~baedke] , [~stefanegli] ,
I added below code to handle the case where fromRev.pmin(minRevisions) results
in an empty vector.
{code:java}
// code placeholder
public static long getMinTimestampForDiff(@NotNull RevisionVector fromRev,
@NotNull RevisionVector toRev, @NotNull RevisionVector minRevisions) { // make
sure we have minimum revisions for all known cluster nodes fromRev =
fromRev.pmax(minRevisions); toRev = toRev.pmax(minRevisions); // keep only
revision entries that changed RevisionVector from = fromRev.difference(toRev);
RevisionVector to = toRev.difference(fromRev); // now calculate minimum
timestamp long min = Long.MAX_VALUE; for (Revision r : from) { min =
Math.min(r.getTimestamp(), min); } for (Revision r : to) { min =
Math.min(r.getTimestamp(), min); } // Handle the case where
fromRev.pmin(minRevisions) results in an empty vector if (from.getDimensions()
== 0 && to.getDimensions() == 0) { for (Revision r : minRevisions) { min =
Math.min(r.getTimestamp(), min); } } return min; }{code}
I checked both test methods that you provided above and it worked.
Could you please check it and see if it fine?
Regards,
Ionut
> DocumentNodeStore#diffManyChildren(...) may produce incorrect results in
> readonly mode
> --------------------------------------------------------------------------------------
>
> Key: OAK-10812
> URL: https://issues.apache.org/jira/browse/OAK-10812
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: documentmk
> Reporter: Manfred Baedke
> Assignee: Manfred Baedke
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)