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

Explain does not respect maxTimeMS

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.7.0, 3.6.23, 4.0.23, 4.2.13, 4.4.5
    • None
    • None
    • Fully Compatible
    • ALL
    • v4.4, v4.2, v4.0, v3.6
    • Query 2020-05-04, Query 2020-05-18

    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

              andrew.paroski@mongodb.com Drew Paroski
              christopher.harris@mongodb.com Christopher Harris
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: