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

Allow renamed nodes to be merged by oak-upgrade

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.8.17, 1.10.6
    • None
    • upgrade
    • None

    Description

      This improvement request relates to oak-upgrade in combination with using the --merge-paths flag.

      A merge will fail if the new repository already has a copy of the old repository and a node at the source has been renamed. The renamed node would be copied over to the destination repository which contains the node with the original name. Both share the same UUID and the content merge will fail with an OakConstraint0030.

      Here is a use case:

      1. Production System: „/content/example“ is created.
      2. Production System is copied over prior to migration to Staging System.
      3. Production System: "/content/example" is renamed to "/content/example-backup".
      4. Production System:  "/content/example" is created with different content to before.
      5. java -jar crx2oak.jar --copy-binaries --src-datastore=/source/datastore --datastore=/destination/datastore \
        --include-paths=/content --merge-paths=/content \
        /source /destination

      Current behaviour:

      oak-upgrade fails with this message:

      Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakConstraint0030: Uniqueness constraint violated property [jcr:uuid] having value 12345678-1234-1234-1234-123456789012: /content/example-backup, /content/example

       

      Desired behaviour:

      Option 1: If there are duplicate UUIDs, oak-upgrade should assume a rename so already existing destination nodes should be dropped and the new one copied.

      Option 2: If there are duplicate UUIDs, oak-upgrade should assume a rename so already existing destination nodes should be versioned and dropped and the new one copied.

       

      Flags --copy-orphaned-versions and --copy-versions should be respected.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bluhm Stefan Bluhm
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: