[
https://issues.apache.org/jira/browse/OAK-4321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15277870#comment-15277870
]
Marcel Reutegger commented on OAK-4321:
---------------------------------------
The check is not quite correct, it will report that a revision is older than
the base revision vector when it is actually equal. I think the patch should
look like this:
{noformat}
---
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Commit.java
+++
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Commit.java
@@ -42,6 +42,7 @@ import org.apache.jackrabbit.oak.spi.state.NodeState;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Iterables.transform;
@@ -565,6 +566,10 @@ public class Commit {
private String formatConflictRevision(Revision r) {
if (nodeStore.getHeadRevision().isRevisionNewer(r)) {
return r + " (not yet visible)";
+ } else if (baseRevision != null
+ && !baseRevision.isRevisionNewer(r)
+ && !equal(baseRevision.getRevision(r.getClusterId()), r)) {
+ return r + " (older than base - " + baseRevision + ")";
} else {
return r.toString();
}
{noformat}
> Improve conflict exception message to show if conflict is unexpected
> --------------------------------------------------------------------
>
> Key: OAK-4321
> URL: https://issues.apache.org/jira/browse/OAK-4321
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core, documentmk
> Reporter: Vikas Saurabh
> Assignee: Vikas Saurabh
> Priority: Minor
> Labels: candidate_oak_1_0, candidate_oak_1_2, candidate_oak_1_4
> Fix For: 1.6
>
> Attachments: OAK-4321-1.0.diff
>
>
> Merge exception (aka OakMergeXXXX) are often expected when concurrent
> sessions do conflicting writes. But in some occasions, we've seen bugs in oak
> which also lead to merge exception.
> This creates confusion during investigation to isolate if it's an issue in
> oak or a genuine concurrent conflict.
> It'd be useful if the exception message has information to distinguish that.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)