[
https://issues.apache.org/jira/browse/OAK-3864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15093756#comment-15093756
]
Michael Dürig commented on OAK-3864:
------------------------------------
I see 2 approaches to fixing this:
# fix the cleanup to be able to cope with cycles in the segment graph
# re-establish the invariant that segments never have forward references
While that invariant is certainly a very nice property to have, it has never
been strictly enforced. Even before OAK-1828 you could have run into this
situation by writing to the file store through multiple segment writers in a
certain way. The only reason we did not see the problem there is because we
didn't do this. With the current approach where we stripe writing segment
across various segment buffer writers it seems very hard to re-establish the
invariant.
OTOH making cleanup cope with cycles / forward references in the segment graph
probably means we need to turn this simple one pass algorithm into a two pass
mark and sweep like approach.
> 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)