[SERVER-12636] 'text' command not honoring maxTimeMS Created: 06/Feb/14  Updated: 10/Dec/14  Resolved: 26/Feb/14

Status: Closed
Project: Core Server
Component/s: Concurrency
Affects Version/s: 2.5.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Robert Moore Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux XXX 3.12.8-300.fc20.x86_64 #1 SMP Thu Jan 16 01:07:50 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ ./mongod --version
db version v2.5.5
2014-02-03T19:51:00.678-0500 git version: 5f2ad3f6411cb1c727e4b836798b8ef06de25f2d
$ ./mongo --version
MongoDB shell version: 2.5.5


Operating System: Linux
Steps To Reproduce:

See description.

Participants:

 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
}



 Comments   
Comment by Daniel Pasette (Inactive) [ 26/Feb/14 ]

Thanks again for the report Robert. Agreed that this does not need to be fixed for 2.6.0.

Comment by Robert Moore [ 26/Feb/14 ]

Given that the 'text' command is deprecated in 2.6 I think this ticket can just be closed.

Generated at Thu Feb 08 03:29:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.