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 "Michael Dürig (JIRA)" <ji...@apache.org> on 2017/08/31 07:17:00 UTC

[jira] [Comment Edited] (OAK-6601) SegmentWriteOperation.isOldGeneration() too eager

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

Michael Dürig edited comment on OAK-6601 at 8/31/17 7:16 AM:
-------------------------------------------------------------

The initial POC for tail compaction had an [extra clause|https://github.com/mduerig/jackrabbit-oak/blob/OAK-3349-POC/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentWriter.java#L1117-L1123] in the {{isOldGeneration()}} predicate, which would never consider tail compacted segments as old. ({{thatGen % 2 == 0}} indicates that segment is *not* tail compacted). 
Somehow this got lost in the [implementation in trunk|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/DefaultSegmentWriter.java#L991-L993]. However the situation in trunk is a bit more involved than it was in the POC as now the predicate also needs to worry about full compaction. That is, the predicate cannot simply exclude all tail compacted segments as it did in the POC.
The proposed [fix|https://github.com/mduerig/jackrabbit-oak/blob/OAK-3349-tail-patch/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/DefaultSegmentWriter.java#L990-L997] is to consider tail compacted segments as old iff they are from an older full generation. 


was (Author: mduerig):
The initial POC for tail compaction had an [extra clause|https://github.com/mduerig/jackrabbit-oak/blob/OAK-3349-POC/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentWriter.java#L1117-L1123] in the {{isOldGeneration()}} predicate, which would never consider tail compacted segments as old. ({{thatGen % 2 == 0}} indicates that segment is *not* tail compacted). 
Somehow this got lost in the [implementation in trunk|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/DefaultSegmentWriter.java#L991-L993]. However the situation in trunk is a bit more involved than it was in the POC as now the predicate also needs to worry about full compaction. That is, the predicate cannot simply exclude all tail compacted segments as it did in the POC.

> SegmentWriteOperation.isOldGeneration() too eager
> -------------------------------------------------
>
>                 Key: OAK-6601
>                 URL: https://issues.apache.org/jira/browse/OAK-6601
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segment-tar
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>              Labels: compaction, gc
>             Fix For: 1.7.7
>
>
> The {{SegmentWriteOperation.isOldGeneration()}} predicate includes some segments that are not "old". This leads to more deferred compaction operations than strictly necessary. The affected segments are those generated by tail compaction. Tail compaction created segments should only be included in the predicate once they are from another full compaction operation. Otherwise referencing such segments is fine as they will not be reclaimed in a cleanup following a tail compaction.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)