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

Compaction Map predicate should use cached state for evaluation

    XMLWordPrintableJSON

Details

    Description

      In the case of offline compaction, the Compactor predicate would try to evaluate if a specific node is candidate for the map of not based on a set of conditions.
      To evaluate said conditions, the predicate currently uses the compacted state, the one that was just written by the SegmentWriter [0], but this offers very poor performance as this NodeState will be accessed from the TarWriter directly, a very IO intensive call (no memory mapping, no caching of the segment) [1].
      A much better thing is to use the cached nodestate, in my local test (on a SSD) this accounts for 10% of perf loss, I would imagine the gains are more significant on a non-SSD disk.

      [0] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/Compactor.java#L252
      [1] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/TarWriter.java#L190

      Attachments

        1. tar-writer-trace.png
          217 kB
          Alex Deparvu

        Activity

          People

            stillalex Alex Deparvu
            stillalex Alex Deparvu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: