Update conflict detection should be optimized for big documents

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.2.10
    • Component/s: Performance, Write Ops
    • None
    • Query
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When updating document with hundreds of properties, the time spent in update conflict detection is high.

      The FieldRefSet::insert is visible in flame graph.

      Attached is a js script that reproduce the problem that create a bottleneck in production.

      Just for information, we also do update conflict detection on our application before submitting the update commands to MongoDB. We had the same performance problem using a similar algorithm, this has been fixed using a different approach:
      https://github.com/nuxeo/nuxeo/commit/eeceab7024445b88082f7406290478d9f6702c28

        1. update-conflict-test.js
          0.3 kB
        2. update-conflict.png
          update-conflict.png
          57 kB
        3. update-conflict.svg
          980 kB
        4. update-conflict-prod.svg
          78 kB

            Assignee:
            Backlog - Query Team (Inactive)
            Reporter:
            Delbosc Benoit
            Votes:
            0 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: