[
https://issues.apache.org/jira/browse/OAK-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13566334#comment-13566334
]
Mete Atamel commented on OAK-585:
---------------------------------
In light of all this, this is what I propose to do with CommitCommand:
1- Add ConcurrentCommitException that saveNodesAndCommits and
saveAndSetHeadRevision would throw when a concurrent commit is detected (i.e.
headRevisionId changed).
2- Reserve ConflictingCommitCommitException for readAndMergeExistingNodes.
3- Change CommitCommand to retry only on ConcurrentCommitException and not on
ConflictingCommitException.
4- Remove conflict detection (as it doesn't work in subsequent commits) from
saveAndSetHeadRevision and make it throw ConcurrentCommitException when
headRevisionId is different.
5- Remove the internal retry mechanism in CommitCommand (as it's confusing
along with retry mechanism of DefaultCommandExecutor) and either increase
numOfRetries or even remove numOfRetries altogether.
6- In retry, make sure nodes and commits are cleaned up.
7- Add conflict detection to readAndMergeExistingNodes that would throw
ConflictingCommitException (in a separate bug probably).
> Reduce cost of commit retry
> ---------------------------
>
> Key: OAK-585
> URL: https://issues.apache.org/jira/browse/OAK-585
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: mongomk
> Affects Versions: 0.6
> Reporter: Marcel Reutegger
> Attachments: OAK-585-1&2.patch, OAK-585-1&2.patch, OAK-585-1.patch,
> OAK-585-2.patch, OAK-585-3.patch
>
>
> MongoMK currently has a retry mechanism when it commits changes. Its main
> purpose is to make sure the headRevId in the sync collection is updated
> consistently and concurrent conflicting commits are detected. Under higher
> concurrency it may happen that commits are retried multiple times, even when
> commits are non-conflicting. In this case its only about consistently
> updating the headRevId. When this happens the commit will get a new revision
> and the nodes of the commit are written again with the new revision, even
> though no changes to the nodes are needed. Only the revision needed an update.
> The cost of a retry should be reduced in this case. At least a commit retry
> should not leave garbage in the nodes and commits collections.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira