[ https://issues.apache.org/jira/browse/OAK-2472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Davide Giannella updated OAK-2472: ---------------------------------- Attachment: oak-1452185608.log.gz [~mduerig], [~mreutegg] The process is there but still there's an exception we can't catch. The IT fails as of this. In the [attached log file|^oak-1452185608.log.gz] you can see we catch several time merging exceptions and we re-schedule the process successfully. Nevertheless the test fails with the following exception {noformat} javax.jcr.InvalidItemStateException: OakMerge0004: OakMerge0004: The node 1:/counter was changed in revision r1521ce9f324-0-1 (not yet visible), which was applied after the base revision r1521cea6128-0-3, before r1521ceaca52-0-3 (retries 5, 25530 ms) at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:239) at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:212) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.newRepositoryException(SessionDelegate.java:670) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:496) at org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.performVoid(SessionImpl.java:419) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:274) at org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:416) at org.apache.jackrabbit.oak.jcr.AtomicCounterClusterIT$1.call(AtomicCounterClusterIT.java:127) at org.apache.jackrabbit.oak.jcr.AtomicCounterClusterIT$1.call(AtomicCounterClusterIT.java:1) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakMerge0004: OakMerge0004: The node 1:/counter was changed in revision r1521ce9f324-0-1 (not yet visible), which was applied after the base revision r1521cea6128-0-3, before r1521ceaca52-0-3 (retries 5, 25530 ms) at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.merge0(DocumentNodeStoreBranch.java:200) at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.merge(DocumentNodeStoreBranch.java:124) at org.apache.jackrabbit.oak.plugins.document.DocumentRootBuilder.merge(DocumentRootBuilder.java:158) at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.merge(DocumentNodeStore.java:1506) at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:247) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.commit(SessionDelegate.java:347) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:494) ... 7 more Caused by: org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 1:/counter was changed in revision r1521ce9f324-0-1 (not yet visible), which was applied after the base revision r1521cea6128-0-3, before r1521ceaca52-0-3 at org.apache.jackrabbit.oak.plugins.document.Commit.checkConflicts(Commit.java:583) at org.apache.jackrabbit.oak.plugins.document.Commit.createOrUpdateNode(Commit.java:487) at org.apache.jackrabbit.oak.plugins.document.Commit.applyToDocumentStore(Commit.java:371) at org.apache.jackrabbit.oak.plugins.document.Commit.applyToDocumentStore(Commit.java:265) at org.apache.jackrabbit.oak.plugins.document.Commit.applyInternal(Commit.java:234) at org.apache.jackrabbit.oak.plugins.document.Commit.apply(Commit.java:219) at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.persist(DocumentNodeStoreBranch.java:290) at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.persist(DocumentNodeStoreBranch.java:260) at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.access$2(DocumentNodeStoreBranch.java:257) at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch$InMemory.merge(DocumentNodeStoreBranch.java:498) at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.merge0(DocumentNodeStoreBranch.java:180) ... 13 more {noformat} Which is tracked as well in the attached log. Any clue on how/if we can catch this exception? Here where we consolidate and merge https://github.com/davidegiannella/jackrabbit-oak/blob/OAK-2472/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/atomic/AtomicCounterEditor.java#L407 I have another perplexity with the approach we took. To each {{ConsolidatorTask}} I assign (what it should be) a unique name (which can be improved anyhow). So far it is composed by {{path-revisionproperty-revisionpropertyvalue}}. From here you can see that more than one process takes the same revision. This is due, I think, the MVCC aspect. When several threads starts they see, at the beginning for example, {{:rev-1 = 0}}. It seems to be not a problem from a consolidation POV due to the checks we have in place; but still it's a bit fishy. Any help appreciated. > Add support for atomic counters on cluster solutions > ---------------------------------------------------- > > Key: OAK-2472 > URL: https://issues.apache.org/jira/browse/OAK-2472 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: core > Affects Versions: 1.3.0 > Reporter: Davide Giannella > Assignee: Davide Giannella > Labels: scalability > Fix For: 1.4 > > Attachments: atomic-counter.md, oak-1452185608.log.gz > > > As of OAK-2220 we added support for atomic counters in a non-clustered > situation. > This ticket is about covering the clustered ones. -- This message was sent by Atlassian JIRA (v6.3.4#6332)