Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9717

IndexDefMergerUtils Should not Remove Nodes From Product Index Definition

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.42.0
    • 1.44.0
    • indexing, oak-run
    • None

    Description

      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:

      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
              }
            }
          }
        }
      }
      

      Calling IndexDefMergerUtils.merge(newIndexes, allIndexes) would result in an index with the property:

      index-2-custom-1: {   
          indexRules: {
            nt:base: {
              property2: {
                name: someproperty
              }
            }
          }
         merges: [index-2, index-1-custom-1]
        } 
      

      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.

      Attachments

        Issue Links

          Activity

            People

              thomasm Thomas Mueller
              dklco Dan Klco
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: