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

Michael Dürig commented on OAK-3864:
------------------------------------

Thinking a bit more about this I came to the conclusion that 2. is not 
feasible: it would put constraints on the order in which segment buffer writers 
could flush. This would either re-introduce blocking (which to remove was a 
purpose of OAK-1828) or require a much deeper refactoring effectively 
redesigning the way segments are written and flushed. 

1. should be feasible. Exploiting the fact that forward references are rare and 
only span a few segments it should even be possible to fix cleanup without 
having to resort to a full fledged mark and sweep. The idea would be to do a 
first forward pass over the segments collecting the forward references. The 
following backward pass would then use those to augment the reference set 
passed along. 



> Filestore cleanup removes referenced segments
> ---------------------------------------------
>
>                 Key: OAK-3864
>                 URL: https://issues.apache.org/jira/browse/OAK-3864
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segmentmk
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>            Priority: Blocker
>              Labels: regression
>             Fix For: 1.3.14
>
>
> In some situations {{FileStore.cleanup()}} may remove segments that are still 
> referenced, subsequently causing a {{SNFE}}. 
> This is a regression introduced with OAK-1828. 
> {{FileStore.cleanup()}} relies on the ordering of the segments in the tar 
> files: later segments only reference earlier segments. As we have seen in 
> other places this assumption does not hold any more (e.g. OAK-3794, OAK-3793) 
> since OAK-1828.
>  {{cleanup}} traverses the segments backwards maintaining a list of 
> referenced ids. When a segment is not in that list, it is removed. However, 
> this approach does not work with forward references as those are only seen 
> later when the segment has been removed already. 
> cc [~alex.parvulescu], [~frm]



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

Reply via email to