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/08/13 14:50:00 UTC

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

Stefan Egli created OAK-9176:
--------------------------------

             Summary: 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


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

For repositories created prior to 1.8 an [upgrade|https://jackrabbit.apache.org/oak/docs/nodestore/document/upgrade.html] mechanism was introduced: 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 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)