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 "Stefan Egli (Jira)" <ji...@apache.org> on 2020/11/17 16:32:00 UTC

[jira] [Comment Edited] (OAK-9176) sweep upgrade of pre 1.8 branch commits not always sets "_bc" for parents/root

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

Stefan Egli edited comment on OAK-9176 at 11/17/20, 4:31 PM:
-------------------------------------------------------------

* document/upgrade.md updated with notes on sweep2 and how to disable it if it causes problems: rev [1882484|http://svn.apache.org/viewvc?rev=1882484&view=rev]


was (Author: egli):
* document/upgrade.md updated with notes on sweep2 and how to disable it if it causes problems: rev [1882482|http://svn.apache.org/viewvc?rev=1882482&view=rev]

> sweep upgrade of pre 1.8 branch commits not always sets "_bc" for parents/root
> ------------------------------------------------------------------------------
>
>                 Key: OAK-9176
>                 URL: https://issues.apache.org/jira/browse/OAK-9176
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: documentmk
>    Affects Versions: 1.32.0
>            Reporter: Stefan Egli
>            Assignee: Stefan Egli
>            Priority: Major
>             Fix For: 1.36.0
>
>
> OAK-5869 in Oak 1.8 introduced the _annotation of documents with branch commits_ for facilitating Revision GC. This means that branch commits from 1.8 on are reflected in an explicit {{"_bc"}} entry (a.s [branches|https://jackrabbit.apache.org/oak/docs/nodestore/documentmk.html#branches] docu for further details).
> Generally speaking {{"_bc"}} are set in the following cases:
>  # for property changes on the document itself
>  # for new children (ie via {{"_deleted" : "false"}}) on the new child's document
>  # for parents of new children (ie via {{"_commitRoot": ".."}} to indicate a change for conflict handling) on the parent's document
>  # for the root document (or more precisely the commitRoot, which for branch commits is the root)
> For repositories created prior to 1.8 an [upgrade|https://jackrabbit.apache.org/oak/docs/nodestore/document/upgrade.html] mechanism was [introduced|https://github.com/apache/jackrabbit-oak/commit/e2aad1c0e867b148e81d4de9001e18551c1d8a5c] (in OAK-3712): a _sweep_ takes care of automatically annotating existing pre-1.8 documents accordingly. This is ultimately handled in [{{NodeDocumentSweeper.sweepOne}}|https://github.com/apache/jackrabbit-oak/blob/d35346d4d446908c7019e931cb54d88824c1a637/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocumentSweeper.java#L179] which is happening via invocation to {{forceBackgroundSweep}}.
> This upgrade mechanism is not properly handling the last 2 aspects (listed above), *if* the parent/root node itself doesn't have any further property changes. This is due to the fact that sweepOne(), in charge of the upgrade, only considers [PROPERTY_OR_DELETED|https://github.com/apache/jackrabbit-oak/blob/d35346d4d446908c7019e931cb54d88824c1a637/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocumentSweeper.java#L181] document entries (missing otherwise unchanged parents and root).
> This can therefore lead to nodes that had children created before Oak 1.8 to not have a {{"_bc"}} entry - besides the root which might also not have pre Oak 1.8 branch commit {{"_bc"}} entries.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)