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 2015/08/21 10:02:46 UTC

[jira] [Commented] (OAK-2527) Update SegmentMK header format definition

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

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

FTR, starting Oak versions pre-dating this fix on a later repository format will cause the following {{ISE}}:

{noformat}
java.lang.IllegalStateException: null
	at com.google.common.base.Preconditions.checkState(Preconditions.java:134)
	at org.apache.jackrabbit.oak.plugins.segment.Segment.<init>(Segment.java:129)
	at org.apache.jackrabbit.oak.plugins.segment.file.FileStore.readSegment(FileStore.java:510)
	at org.apache.jackrabbit.oak.plugins.segment.SegmentTracker.getSegment(SegmentTracker.java:106)
	at org.apache.jackrabbit.oak.plugins.segment.SegmentId.getSegment(SegmentId.java:97)
	at org.apache.jackrabbit.oak.plugins.segment.Record.getSegment(Record.java:68)
	at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.getTemplate(SegmentNodeState.java:74)
	at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeState.getChildNode(SegmentNodeState.java:334)
	at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore.getRoot(SegmentNodeStore.java:117)
	at org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore.<init>(SegmentNodeStore.java:80)
{noformat}

> Update SegmentMK header format definition
> -----------------------------------------
>
>                 Key: OAK-2527
>                 URL: https://issues.apache.org/jira/browse/OAK-2527
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: segmentmk
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>             Fix For: 1.0.12, 1.1.8
>
>
> Even though the Oak's [segment header format | http://jackrabbit.apache.org/oak/docs/nodestore/segmentmk.html] defines a version, that version is not checked when running Oak. In effect this means current Oak versions pretend to be infinitely forward compatible. 
> To prevent older versions of Oak to run with incompatible, newer storage formats we need to devise a way for Oak to fail fast in that scenario. 
> One thing we could do to introduce versions checking retroactively is to redefine the segment header format from:
> {noformat}
> +--------+--------+--------+--------+--------+--------+--------+--------+
> | magic bytes: "0aK\n" in ASCII     |version |idcount |rootcount        |
> +--------+--------+--------+--------+--------+--------+--------+--------+
> {noformat}
> to: 
> {noformat}
> +--------+--------+--------+--------+--------+--------+--------+--------+
> | magic bytes: "0aK" ASCII |version |reserved|idcount |rootcount        |
> +--------+--------+--------+--------+--------+--------+--------+--------+
> {noformat}
> where version would be {{10}} for the current storage format and {{11}} for the next storage format. 



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