[
https://issues.apache.org/jira/browse/OAK-2879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14941271#comment-14941271
]
Francesco Mari commented on OAK-2879:
-------------------------------------
bq. This doesn't properly cancel diffing while busy inside a big sub-tree
AFAICS. Maybe passing a Predicate into the diffs to determine the cancellation
status would work better?
Yes, my solution is broken. I like the idea of the {{Predicate}}, I will rework
the approach.
bq. What is the idea re. CompactionStrategy#isDiskSpaceSufficient? Currently
that method just returns true so compaction would never be cancelled.
The patch is far to be complete, the method was there just to show how the
{{CompactionStrategy}} could influence compaction with regard to disk space. I
still didn't come up with a proper heuristic to stop compaction.
bq. Do really need the current size? Can we call it less often?
Yes, the method should probably be called less often. But what is the right
frequency of the background thread checking the disk space? Should the thread
be always active? Should the thread be active only when compaction is running,
instead? What if, instead of checking the disk space via {{size()}}, we
increment the known size of the store using {{FileStore#writeSegment()}} as a
hook? In this case, we can reset the size after a cleanup.
There is still some thinking to do before the patch will be complete, but now
that I know that the approach is correct (on a very high level) I can improve
on what I have.
> Compaction should check for required disk space before running
> --------------------------------------------------------------
>
> Key: OAK-2879
> URL: https://issues.apache.org/jira/browse/OAK-2879
> Project: Jackrabbit Oak
> Issue Type: Sub-task
> Components: segmentmk
> Reporter: Michael Dürig
> Assignee: Francesco Mari
> Labels: compaction, doc-impacting, gc, resilience
> Fix For: 1.3.8
>
> Attachments: OAK-2879-01.patch, OAK-2879-02.patch
>
>
> In the worst case compaction doubles the repository size while running. As
> this is somewhat unexpected we should check whether there is enough free disk
> space before running compaction and log a warning otherwise. This is to avoid
> a common source of running out of disk space and ending up with a corrupted
> repository.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)