[
https://issues.apache.org/jira/browse/OAK-5971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15940336#comment-15940336
]
Andrei Dulceanu commented on OAK-5971:
--------------------------------------
bq. I can't see how the size of the repo is relevant here.
Right, I was thinking the same, but since I was checking the validity of the
journal, I said to check also the size after compaction. I can remove the size
check to simplify the test case.
bq. You can augment an existing offline compaction test and simply focus on
checking the journal is not getting corrupted.
Initially I tried the same, but then I realised that the bug happened only for
calls to {{Compact#compact}} [1] which rewrites the {{journal}} to contain only
the head revision. Augmenting an offline compaction IT won't prevent breaking
{{oak-run compact}} since it deals only with updating the {{journal}} from
{{TarRevisions#doFlush}} [2]. In turn this is successfully tested by
{{TarRevisionsTest}} [3].
[1]
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Compact.java#L123
[2]
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/TarRevisions.java#L215
[3]
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/TarRevisionsTest.java
> Offline compaction corrupts the journal
> ---------------------------------------
>
> Key: OAK-5971
> URL: https://issues.apache.org/jira/browse/OAK-5971
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: segment-tar
> Reporter: Alex Parvulescu
> Assignee: Andrei Dulceanu
> Fix For: 1.7.0, 1.8
>
> Attachments: OAK-5971-02.patch, OAK-5971.patch
>
>
> Seems offline compaction corrupts the journal by persisting an illegal value
> as the head state.
> Pre Compaction:
> {noformat}
> ~ head segmentstore/journal.log
> 244b31cd-031d-48f2-ac64-d196ebccb43a:625 root 1490200945396
> accca99a-8829-4e16-a158-c75c08d92252:1580 root 1490200951316
> b188d865-9e26-4263-a9f1-5db3de9e8bfa:1724 root 1490200955354
> {noformat}
> Post Compaction:
> {noformat}
> ~ head segmentstore/journal.log
> org.apache.jackrabbit.oak.segment.file.JournalEntry@f2680686 root
> 1490201167938
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)