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

listCollections accepts but does not enforce the maxTimeMS option.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.0.0-rc8
    • Component/s: Storage
    • ALL
    • Hide

      From the Shell using 3.0.0-rc8

      // Create 10000 collections.
      > for (var i =0; i < 10000; ++i ) db.getCollection( "test_" + i ).insert({});
      WriteResult({ "nInserted" : 1 })
      
      // Time and run the listCollections command.
      > var start = new Date().getTime(); db.runCommand({"listCollections" : 1, maxTimeMS : 1}); print(new Date().getTime() - start);
      9711
      
      Show
      From the Shell using 3.0.0-rc8 // Create 10000 collections. > for ( var i =0; i < 10000; ++i ) db.getCollection( "test_" + i ).insert({}); WriteResult({ "nInserted" : 1 }) // Time and run the listCollections command. > var start = new Date().getTime(); db.runCommand({ "listCollections" : 1, maxTimeMS : 1}); print( new Date().getTime() - start); 9711
    • Storage NYC 2018-06-18

      The listCollections command accepts the maxTimeMS option but does not enforce the timeout.

      This is a regression from the 2.6.X model which performed a query on the system.namespaces collection which does enforce the timeout.

      Note that the server does imply that the command supports the maxTimeMS with the following error message:

      > db.runCommand({"listCollections" : 1, $maxTimeMS : 1}); 
      {
      	"ok" : 0,
      	"errmsg" : "no such command option $maxTimeMS; use maxTimeMS instead"
      }
      

            Assignee:
            ben.judd Ben Judd
            Reporter:
            robert.j.moore@allanbank.com Robert Moore
            Votes:
            1 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: