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

Robert Munteanu commented on OAK-2682:
--------------------------------------

As far as I can tell there is no method of executing commands between Oak 
cluster nodes, so we need to compare the current time values to another source. 
For MongoDB the best bet would be the database itself. I see two ways:

1. Run a command on mongoDB to get the current time, e.g. 
[hostInfo|http://docs.mongodb.org/manual/reference/command/hostInfo/]  and 
compare it to the local time
1. Use the {{clusterNodes}} collection to store the timestamps. Each cluster 
node would include a timestamp it generated using System.currentTimeMillis and 
the mongo server time ( 
[$currentDate|http://docs.mongodb.org/manual/reference/operator/update/currentDate/]
 ).

I'm not sure what the trade-offs are here, but storing the data in the 
clusterNodes collection makes it much simpler to inspect outside of Oak, but we 
probably have to write-then-read to generate warnings from Oak.

At any rate, would it make sense to return this information as part of the 
ClusterNodeInfo?

> Introduce time difference detection for mongoMk
> -----------------------------------------------
>
>                 Key: OAK-2682
>                 URL: https://issues.apache.org/jira/browse/OAK-2682
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core, mongomk
>            Reporter: Stefan Egli
>             Fix For: 1.3.0
>
>
> Currently the lease mechanism in DocumentNodeStore/mongoMk is based on the 
> assumption that the clocks are in perfect sync between all nodes of the 
> cluster. The lease is valid for 60sec with a timeout of 30sec. If clocks are 
> off by too much, and background operations happen to take couple seconds, you 
> run the risk of timing out a lease. So introducing a check which WARNs if the 
> clocks in a cluster are off by too much (1st threshold, eg 5sec?) would help 
> increase awareness. Further drastic measure could be to prevent a startup of 
> Oak at all if the difference is for example higher than a 2nd threshold 
> (optional I guess, but could be 20sec?).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to