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 "Stefan Eissing (JIRA)" <ji...@apache.org> on 2017/03/01 14:39:45 UTC

[jira] [Commented] (OAK-4780) VersionGarbageCollector should be able to run incrementally

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

Stefan Eissing commented on OAK-4780:
-------------------------------------

Here

https://github.com/apache/jackrabbit-oak/compare/trunk...icing:revision-garbage-collector?expand=1

is a version 0.1 of an incremental, adapting VersionGarbageCollector strategy.

Key points:
- it tracks the lastOldestTimestamp, just like OAK-3070
- it queries only against the newly calculated timestamp (just like trunk now)
- it uses a precisionMs for the minimal time interval to use, configurable
- it enforces a maximum number of collected documents (to be sorted), configurable

The algorithm tries to find the best time interval, calculated from the last successful run or the oldest revision to be found, so that Garbage Collection may run without hitting the limit on the amount of documents to be sorted.

If collection limit is reached, the run is stopped and the time interval for the next run is reduced by 50%. So, this shrinks very fast if it encounters a time with many positive delete candidates. It grows a bit slower when the number of collected docs stayed significantly below the limit.

It has no preferred maintenance interval. It can be called repeatedly. 

Questions:
1. Shall it repeat itself when it has not caught up to "now" (minus MaxRevisionAge).
2. What is the best value for "precisionMs", the minimal time interval for queries?


> VersionGarbageCollector should be able to run incrementally
> -----------------------------------------------------------
>
>                 Key: OAK-4780
>                 URL: https://issues.apache.org/jira/browse/OAK-4780
>             Project: Jackrabbit Oak
>          Issue Type: Task
>          Components: core, documentmk
>            Reporter: Julian Reschke
>         Attachments: leafnodes.diff, leafnodes-v2.diff, leafnodes-v3.diff
>
>
> Right now, the documentmk's version garbage collection runs in several phases.
> It first collects the paths of candidate nodes, and only once this has been successfully finished, starts actually deleting nodes.
> This can be a problem when the regularly scheduled garbage collection is interrupted during the path collection phase, maybe due to other maintenance tasks. On the next run, the number of paths to be collected will be even bigger, thus making it even more likely to fail.
> We should think about a change in the logic that would allow the GC to run in chunks; maybe by partitioning the path space by top level directory.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)