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

'text' command not honoring maxTimeMS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 2.5.5
    • Fix Version/s: None
    • Component/s: Concurrency
    • Labels:
      None
    • Environment:
    • Operating System:
      Linux
    • Steps To Reproduce:
      Hide

      See description.

      Show
      See description.

      Description

      This is a fork from ticket SERVER-12595 which was used to fix a similar problem with findAndModify.

      The 'text' command is not aborting the command when provided a maxTimeMS.

      > db.testData.drop()
      true
      > for (var i = 1; i <= 100000; i++) db.testData.insert( { x : i, "text" : "Now is the time for all good men to come to the aid of..." } )
      SingleWriteResult({
          "writeErrors" : [ ],
          "writeConcernErrors" : [ ],
          "nInserted" : 1,
          "nUpserted" : 0,
          "nUpdated" : 0,
          "nModified" : 0,
          "nRemoved" : 0,
          "upserted" : [ ]
      })> db.testData.stats()
      {
          "ns" : "test.testData",
          "count" : 100000,
          "size" : 11200000,
          "avgObjSize" : 112,
          "storageSize" : 22507520,
          "numExtents" : 7,
          "nindexes" : 2,
          "lastExtentSize" : 11325440,
          "paddingFactor" : 1,
          "systemFlags" : 1,
          "userFlags" : 1,
          "totalIndexSize" : 21723632,
          "indexSizes" : {
              "_id_" : 3262224,
              "text_text" : 18461408
          },
          "ok" : 1
      }
      > db.testData.runCommand( "text" , { search : "good" , maxTimeMS : 100 } )
      {
          "results" : [
      <snip/>
          ],
          "stats" : {
              "nscanned" : NumberLong(100000),
              "nscannedObjects" : NumberLong(100000),
              "n" : 100,
              "timeMicros" : 145226
          },
          "ok" : 1
      }

      In the server log we get confirmation that the command took longer than 100ms.

      [conn1] command test.$cmd command: { text: "testData", search: "good", maxTimeMS: 100.0 } keyUpdates:0 numYields:0 locks(micros) r:148545 reslen:13119 148ms

      The above text command was modified from http://docs.mongodb.org/manual/reference/command/text/.

      I also tried the manual command invocation with the same results:

      > db.runCommand( { "text" : "testData", search : "good" , maxTimeMS : 100 } )
      {
          "results" : [
                  // Removed.
          ],
          "stats" : {
              "nscanned" : NumberLong(100000),
              "nscannedObjects" : NumberLong(100000),
              "n" : 100,
              "timeMicros" : 135148
          },
          "ok" : 1
      }

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            robert.j.moore@allanbank.com Robert Moore
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: