You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Tomek Rękawek (JIRA)" <ji...@apache.org> on 2015/10/22 13:48:28 UTC
[jira] [Comment Edited] (OAK-2106) Optimize reads from secondaries
[ https://issues.apache.org/jira/browse/OAK-2106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14968997#comment-14968997 ]
Tomek Rękawek edited comment on OAK-2106 at 10/22/15 11:47 AM:
---------------------------------------------------------------
There's also a second problem with the local changes, pointed by [~catholicon] (thanks!):
1. Last change on /a/b is done at 12:00
2. Secondaries have been sync at 12:05
3. /a/b/c is updated by the local instance at 12:10
4. The background update process, which updates lastRev on /a/b and ancestors is delayed and runs at 12:15.
5. At 12:12 we want to get /a/b/c. The lastRev on /a/b in cache and Mongo is still set to 12:00 (<12:05 safe time), so we use a secondary instance and get an old version.
In case of the remote modification this problem doesn't exist, as the background read uses lastRev at / to check if something has changed (so it'll pull changes after the background update finishes its work).
was (Author: tomek.rekawek):
There's also a second problem with the local changes, pointed by [~catholicon] (thanks!):
1. Last change on /a/b is done at 12:00
2. Safe time for secondaries is 12:05
3. /a/b/c is updated by the local node at 12:10
4. The background update, which updates lastRev on /a/b and ancestors is delayed and runs at 12:15.
5. At 12:12 we want to get /a/b/c. The lastRev on /a/b is still 12:00 (<12:05 safe time), so we use a secondary instance and get an old version.
In case of the remote modification this problem doesn't exist, as the background read uses lastRev at / to check if something has changed (so it'll pull changes after the background update finishes its work).
> Optimize reads from secondaries
> -------------------------------
>
> Key: OAK-2106
> URL: https://issues.apache.org/jira/browse/OAK-2106
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core, mongomk
> Reporter: Marcel Reutegger
> Assignee: Marcel Reutegger
> Labels: performance, scalability
>
> OAK-1645 introduced support for reads from secondaries under certain
> conditions. The current implementation checks the _lastRev on a potentially
> cached parent document and reads from a secondary if it has not been
> modified in the last 6 hours. This timespan is somewhat arbitrary but
> reflects the assumption that the replication lag of a secondary shouldn't
> be more than 6 hours.
> This logic should be optimized to take the actual replication lag into
> account. MongoDB provides information about the replication lag with
> the command rs.status().
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)