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

Explain does not respect maxTimeMS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0, 3.6.23, 4.0.23, 4.2.13, 4.4.5
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.4, v4.2, v4.0, v3.6
    • Sprint:
      Query 2020-05-04, Query 2020-05-18
    • Case:

      Description

      Per this comment in SERVER-41343, explain is expected to respect a maxTimeMS applied to it.  Testing appears to indicate that this is not the case:

      > db.range.find({z:123}).maxTimeMS(1).explain(1).executionStats
      {
      	"executionSuccess" : true,
      	"nReturned" : 0,
      	"executionTimeMillis" : 433,
      	"totalKeysExamined" : 0,
      	"totalDocsExamined" : 1000000,
      	"executionStages" : {
      		"stage" : "COLLSCAN",
      		"filter" : {
      			"z" : {
      				"$eq" : 123
      			}
      		},
      		"nReturned" : 0,
      		"executionTimeMillisEstimate" : 309,
      		"works" : 1000002,
      		"advanced" : 0,
      		"needTime" : 1000001,
      		"needYield" : 0,
      		"saveState" : 7822,
      		"restoreState" : 7822,
      		"isEOF" : 1,
      		"invalidates" : 0,
      		"direction" : "forward",
      		"docsExamined" : 1000000
      	},
      	"allPlansExecution" : [ ]
      } 

      The operation certainly appears to have yielded thousands of times, which is supposed to allow the interruption to happen based on my understanding.  

      The log file suggests that the parameter itself is getting successfully passed to the server:

      command: explain { explain: { find: "range", filter: { z: 123.0 }, maxTimeMS: 1.0 } 

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              andrew.paroski Drew Paroski
              Reporter:
              christopher.harris Christopher Harris
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: