[ 
https://issues.apache.org/jira/browse/OAK-5193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrew Khoury updated OAK-5193:
-------------------------------
    Attachment: OAK-5193-fix-v2.groovy

[~tomek.rekawek] I used this script to fix an Oak repository and ran into a bug 
that caused this error \[1].  decreaseVersion was even being called when the 
version had no ".".  I have updated the script to fix this bug 
[^OAK-5193-fix-v2.groovy]

\[1]
{code:none}
alidating 
SegmentNodeBuilder{path=/jcr:system/jcr:versionStorage/67/2e/04/672e040d-38a7-4b89-bc90-b86ac56fc537}
java.lang.ArrayIndexOutOfBoundsException: Negative array index [-1] too large 
for array size 0
at 
org.codehaus.groovy.runtime.dgmimpl.arrays.ArrayMetaMethod.normaliseIndex(ArrayMetaMethod.java:34)
at 
org.codehaus.groovy.runtime.dgmimpl.arrays.ObjectArrayGetAtMetaMethod$MyPojoMetaMethodSite.call(ObjectArrayGetAtMetaMethod.java:57)
at Oak5193Fixer.decreaseVersion(groovysh_evaluate:130)
at Oak5193Fixer$decreaseVersion$5.callStatic(Unknown Source)
at Oak5193Fixer.closestVersion(groovysh_evaluate:116)
at Oak5193Fixer$closestVersion$4.callStatic(Unknown Source)
at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:53)
at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:157)
at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:169)
at Oak5193Fixer.fixInvalidPredecessor(groovysh_evaluate:58)
at Oak5193Fixer.this$2$fixInvalidPredecessor(groovysh_evaluate)
at Oak5193Fixer$this$2$fixInvalidPredecessor$3.callCurrent(Unknown Source)
at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at Oak5193Fixer.fixVersionHistory(groovysh_evaluate:40)
at Oak5193Fixer.this$2$fixVersionHistory(groovysh_evaluate)
at Oak5193Fixer$this$2$fixVersionHistory$1.callCurrent(Unknown Source)
at Oak5193Fixer.traverse(groovysh_evaluate:19)
at Oak5193Fixer.this$2$traverse(groovysh_evaluate)
at Oak5193Fixer$this$2$traverse$0.callCurrent(Unknown Source)
at Oak5193Fixer.traverse(groovysh_evaluate:21)
at Oak5193Fixer.this$2$traverse(groovysh_evaluate)
at Oak5193Fixer$this$2$traverse$0.callCurrent(Unknown Source)
at Oak5193Fixer.traverse(groovysh_evaluate:21)
at Oak5193Fixer.this$2$traverse(groovysh_evaluate)
at Oak5193Fixer$this$2$traverse$0.callCurrent(Unknown Source)
at Oak5193Fixer.traverse(groovysh_evaluate:21)
at Oak5193Fixer.this$2$traverse(groovysh_evaluate)
at Oak5193Fixer$this$2$traverse$0.callCurrent(Unknown Source)
at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at Oak5193Fixer.traverse(groovysh_evaluate:13)
at Oak5193Fixer.this$2$traverse(groovysh_evaluate)
at Oak5193Fixer$this$2$traverse.call(Unknown Source)
at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
{code}

> Version tree may become inconsistent after removing a version
> -------------------------------------------------------------
>
>                 Key: OAK-5193
>                 URL: https://issues.apache.org/jira/browse/OAK-5193
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: jcr
>    Affects Versions: 1.0.35, 1.2.21, 1.4.10, 1.5.14
>            Reporter: Tomek Rękawek
>            Assignee: Tomek Rękawek
>             Fix For: 1.0.36, 1.2.22, 1.4.11, 1.5.15, 1.6.0
>
>         Attachments: OAK-5193-fix.groovy, OAK-5193-fix-v2.groovy, 
> version-histories.png
>
>
> When a version is removed, its predecessors and successors are connected 
> together, to keep the version tree consistent. However, if the removed 
> version predecessor has its own successors, they are replaced with the 
> removed version successors. Similarly, if the removed version successor has 
> its own predecessors, they'll be replaced with the removed version 
> predecessors.
> !version-histories.png!
> They should be merged together, instead.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to