[ 
https://issues.apache.org/jira/browse/OAK-2879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Francesco Mari updated OAK-2879:
--------------------------------
    Attachment: OAK-2879-01.patch

[^OAK-2879-01.patch] provides a first exploratory implementation. The patch 
applies the following modifications:

- {{FileStore}} has an additional background thread periodically checking the 
available disk space.
- {{CompactionStrategy}} is called by the aforementioned background thread, and 
is ultimately responsible to decide how to react to the lack of disk space.
- {{BackgroundThread}} doesn't stop anymore when interrupts are received. The 
interrupt status, though, is not ignored: the {{Runnable}} can inspect the 
interrupted status of the thread and proactivaly cancel itself ahead of time.
- {{Compactor}} uses an {{InterruptibleDiff}} that stops itself if the current 
thread was interrupted. The {{Compactor}} still returns a {{NodeState}} with 
the compacted changes, but these changes may be partial. A caller has to check 
a flag of the {{Compactor}} to understand if the process was interrupted or not.
- If {{Compactor}} returns partial changes, they are not committed. The written 
changes will be picked up by the next cleanup cycle.

The unit and integration tests don't show regressions on my machine. 
[~mduerig], [~alex.parvulescu], what do you think? Is there any simpler way to 
achieve the same thing?

> 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
>
>
> 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)

Reply via email to