Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-57474

profile_operation_metrics.js not resilient to query yielding

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.2, 5.1.0-rc0
    • Affects Version/s: 5.0.0, 5.1.0
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • Execution Team 2021-06-28, Execution Team 2021-07-12, Execution Team 2021-07-26
    • 152

      When running profile_operation_metrics.js, it's possible for queries to yield. Each yield results in the cursorSeeks metric being incremented. There's a build failure on the debug variants experiencing this behaviour, specifically the findIxScanAndFetch test in profile_operation_metrics.js.

      On a successful run, where there's no yielding, there are 2 cursorSeeks. This is what the test expects.

      [conn1] "Slow query","attr":{"type":"command","ns":"profile_operation_metrics.coll","appName":"MongoDB Shell","command":{"find":"coll","filter":{"_id":1},"lsid":{"id":{"$uuid":"a910abbe-144f-45a6-86b3-efa816fc27ab"}},"$db":"profile_operation_metrics"},"planSummary":"IXSCAN { _id: 1 }","keysExamined":1,"docsExamined":1,"fromMultiPlanner":true,"cursorExhausted":true,"numYields":0,"nreturned":1,"reslen":151,"locks":{"Global":{"acquireCount":{"r":3}},"Mutex":{"acquireCount":{"r":3}}},"storage":{},"operationMetrics":{"docBytesRead":29,"docUnitsRead":1,"idxEntryBytesRead":3,"idxEntryUnitsRead":1,"docUnitsReturned":1,"cursorSeeks":2,"cpuNanos":4718330},"remote":"127.0.0.1:44910","protocol":"op_msg","durationMillis":4}
      

      But when there's a yield, there are 3 cursorSeeks, causing the test to fail.

      [conn1] "Slow query","attr":{"type":"command","ns":"profile_operation_metrics.coll","appName":"MongoDB Shell","command":{"find":"coll","filter":{"_id":1},"lsid":{"id":{"$uuid":"ebdfd9b7-35b7-429a-aba5-315b45fef51f"}},"$db":"profile_operation_metrics"},"planSummary":"IXSCAN { _id: 1 }","keysExamined":1,"docsExamined":1,"fromMultiPlanner":true,"cursorExhausted":true,"numYields":1,"nreturned":1,"reslen":151,"locks":{"Global":{"acquireCount":{"r":6}},"Mutex":{"acquireCount":{"r":5}}},"storage":{},"operationMetrics":{"docBytesRead":29,"docUnitsRead":1,"idxEntryBytesRead":3,"idxEntryUnitsRead":1,"docUnitsReturned":1,"cursorSeeks":3,"cpuNanos":6101484},"remote":"127.0.0.1:43070","protocol":"op_msg","durationMillis":27}
      

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: