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

findAndModify doesn't honour MaxTimeMS

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 2.5.5
    • Write Ops
    • ALL
    • 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

        Activity

          People

            victor.hooi Victor Hooi
            ross@mongodb.com Ross Lawley
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: