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

MongoDocumentStore causes scan of entire nodes collection on startup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.10, 1.9.11, 1.9.12, 1.9.13
    • 1.10.0
    • mongomk
    • None

    Description

      This is a regression introduced with OAK-7645 when the MongoDB Java driver was updated to 3.8.

      With the switch to the new driver, the use of a deprecated method count() was replaced with countDocuments(). The method countDocument() behaves differently and performs an aggregation command over all documents in the collection. The MongoDB log would then show something like:

      2018-12-12T18:40:53.672+0100 I COMMAND  [conn6063] command oak.nodes command: aggregate { aggregate: "nodes", readConcern: { level: "local" }, pipeline: [ { $match: {} }, { $group: { _id: null, n: { $sum: 1 } } } ], cursor: {}, $db: "oak", $readPreference: { mode: "primaryPreferred" } } planSummary: COLLSCAN keysExamined:0 docsExamined:4038809 cursorExhausted:1 numYields:31584 nreturned:1 reslen:127 locks:{ Global: { acquireCount: { r: 31586 } }, Database: { acquireCount: { r: 31586 } }, Collection: { acquireCount: { r: 31586 } } } protocol:op_msg 1642ms
      

      Attachments

        Issue Links

          Activity

            People

              mreutegg Marcel Reutegger
              mreutegg Marcel Reutegger
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: