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

Use Consolidated diff for local changes with persistent cache to avoid calculating diff again

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0.13, 1.2
    • mongomk
    • None

    Description

      Currently the diff logic in DocumentMK makes use of DiffCache which has an in memory implementation and a Mongo based implementation. Given that we need to have a fast observation support for local changes it would be better to make use of persistent cache. After discussing with mreutegg following changes need to be done in current logic

      1. Have the Commit#applyChanges push the commit diff to persistent cache with current commit revision as key
      2. In compare pull out the diff from persistent cache and if present use that. Note that this diff is for complete tree compared to current JSOP diff used which is only per node level. So need to change the way diff is pushed back to NodeStateDiff

      Above change should avoid hitting mongo all together for determining the diff. Only extra work performed in diff calculation would be determining the node state view for the base revision. Later we can think of also include node state base revision as part of diff so as to avoid this extra work all together and rely on node state from persistent cache for that work also

      See also http://markmail.org/thread/bzmwcp7k4wmtw6od

      Attachments

        1. OAK-2669-A.patch
          35 kB
          Chetan Mehrotra
        2. OAK-2669-benchmark.patch
          37 kB
          Chetan Mehrotra

        Issue Links

          Activity

            People

              chetanm Chetan Mehrotra
              chetanm Chetan Mehrotra
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: