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

listCollections accepts but does not enforce the maxTimeMS option.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Gone away
    • Affects Version/s: 3.0.0-rc8
    • Fix Version/s: None
    • Component/s: Storage
    • Labels:
    • Operating System:
      ALL
    • Steps To Reproduce:
      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
    • Sprint:
      Storage NYC 2018-06-18

      Description

      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"
      }
      

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: