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 "Dan Klco (Jira)" <ji...@apache.org> on 2022/04/26 17:26:00 UTC

[jira] [Updated] (OAK-9717) IndexDefMergerUtils Should not Remove Nodes From Product Index Definition

     [ https://issues.apache.org/jira/browse/OAK-9717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Klco updated OAK-9717:
--------------------------
    Fix Version/s: 1.44.0

> IndexDefMergerUtils Should not Remove Nodes From Product Index Definition
> -------------------------------------------------------------------------
>
>                 Key: OAK-9717
>                 URL: https://issues.apache.org/jira/browse/OAK-9717
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: indexing, oak-run
>    Affects Versions: 1.42.0
>            Reporter: Dan Klco
>            Assignee: Thomas Mueller
>            Priority: Major
>             Fix For: 1.44.0
>
>
> *Problem*
> The IndexDefMergerUtils will remove child nodes from merged custom index definitions when the child node is present in the ancestor and new product index, but not in the custom index.
> *Example*
> Given the following indexes:
> {code}
> newIndexes: {
>   index-2: {
>     indexRules: {
>       nt:base: {
>         property1: {
>           name: someproperty
>         }
>       }
>     }
>   }
> }
> allIndexes: 
> {
>   index-1: {
>     indexRules: {
>       nt:base: {
>         property1: {
>           name: someproperty
>         }
>       }
>     }
>   },
>   index-1-custom-1: {
>     indexRules: {
>       nt:base: {
>         property2: {
>           name: someproperty
>         }
>       }
>     }
>   }
> }
> {code}
> Calling IndexDefMergerUtils.merge(newIndexes, allIndexes) would result in an index with the property:
> {code}
> index-2-custom-1: {   
>     indexRules: {
>       nt:base: {
>         property2: {
>           name: someproperty
>         }
>       }
>     }
>    merges: [index-2, index-1-custom-1]
>   } 
> {code}
> *Result*
> Removing node structures in the merging process could allow for catastrophic changes to an index definition by removing key property / node type definitions.
> *Expected Result*
> The merged index would contain all of the nodes defined in the product index. _However_ custom index definitions would still be able to alter definitions by adding new nodes or changing / adding / removing properties from the product definition.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)