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

findAndModify doesn't honour MaxTimeMS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 2.5.5
    • Fix Version/s: None
    • Component/s: Write Ops
    • Labels:
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      In the shell

      t = db.find_and_modify;
      t.drop();
       
      // fill db
      for(var i=1; i<=10000; i++) {
          t.insert({b:i, c:false, d:0});
      }
       
      // Ensure we aren't simulating this.
      t.getDB().adminCommand({configureFailPoint: "maxTimeAlwaysTimeOut", mode: "off"}).ok;
       
      t.find({a:1}).maxTimeMS(1);
      // error: { "$err" : "operation exceeded time limit", "code" : 50 }
       
      t.findAndModify({query:{a:1}, remove:1, maxTimeMS: 1});
      // null
       
      // Test again
      t.find({a:1}).maxTimeMS(1);
      // error: { "$err" : "operation exceeded time limit", "code" : 50 }

      Show
      In the shell t = db.find_and_modify; t.drop();   // fill db for(var i=1; i<=10000; i++) { t.insert({b:i, c:false, d:0}); }   // Ensure we aren't simulating this. t.getDB().adminCommand({configureFailPoint: "maxTimeAlwaysTimeOut", mode: "off"}).ok; t.find({a:1}).maxTimeMS(1); // error: { "$err" : "operation exceeded time limit", "code" : 50 }   t.findAndModify({query:{a:1}, remove:1, maxTimeMS: 1}); // null   // Test again t.find({a:1}).maxTimeMS(1); // error: { "$err" : "operation exceeded time limit", "code" : 50 }

      Description

      Testing on 2.5.6-pre calling {findAndModify} with {maxTimeMS} can take longer than the set duration. Also when doing an equivalent query in a {find} it throws a {operation exceeded time limit} error.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              victor.hooi Victor Hooi
              Reporter:
              ross.lawley Ross Lawley
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: