[ 
https://issues.apache.org/jira/browse/OAK-1295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13950586#comment-13950586
 ] 

Amit Jain commented on OAK-1295:
--------------------------------

The following is the proposed high level approach:
 
* Identifying candidate set missing {{_lastRev}} updates
** Use the cluster node (leaseEnd + asyncDelay) as the upper bound and the 
(leaseEnd - leaseTime) as the lower bound.
** Nodes having _modified time between these are potential candidates for which 
{{_lastRev}} has not been updated.

* Recovery
** Iterate over the candidate set.
** Calculate for each node not itself a commit root, valid {{_lastRev}} by 
checking the revisions in the {{_commitRoot}} for latest valid one.
** If the node is the commit root then order the {{_revisions}} and get the 
latest revision.
** Update {{_lastRev}} when the _lastRev does not match the last commited 
{{_lastRev}}

> Recovery for missing _lastRev updates
> -------------------------------------
>
>                 Key: OAK-1295
>                 URL: https://issues.apache.org/jira/browse/OAK-1295
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core, mongomk
>            Reporter: Marcel Reutegger
>            Assignee: Chetan Mehrotra
>            Priority: Critical
>             Fix For: 0.20
>
>
> The _lastRev fields are periodically written to MongoDB with a background 
> thread.
> This means there may be missing _lastRev updates when an Oak instance crashes.
> There must be a recovery mechanism in place when an Oak instance starts up. 
> MongoMK needs to read the most recent _lastRev for the local cluster id and 
> get
> documents with a _modified timestamp at _lastRev or newer. These are 
> candidates
> for missing _lastRev updates. The _lastRev must only be updated for committed
> non-branch changes.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to