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

Race condition in awaitdata_getmore_cmd.js

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.6.0-rc4
    • 3.6.4, 3.7.3
    • None
    • None
    • Fully Compatible
    • ALL
    • v3.6
    • Query 2018-03-12, Query 2018-03-26
    • 0

    Description

      awaitdata_getmore_cmd.js can encounter an assert.soon() failure in the following code if the time it takes to start the parallelShell exceeds the 4 second maxTimeMS set on the awaitData getMore:

      139
      // getMore should time out if we insert a non-matching document.
      140
      let insertshell = startParallelShell(function() {
      141
          assert.soon(function() {
      142
              return db.currentOp({op: "getmore", "command.collection": "await_data"})
      143
                         .inprog.length == 1;
      144
          });
      145
          assert.writeOK(db.await_data.insert({x: 0}));
      146
      }, mongo.port);
      147
       
      148
      now = new Date();
      149
      cmdRes = db.runCommand({getMore: cmdRes.cursor.id, collection: collName, maxTimeMS: 4000});
      150
      assert.commandWorked(cmdRes);
      151
      assert.gt(cmdRes.cursor.id, NumberLong(0));
      152
      assert.eq(cmdRes.cursor.ns, coll.getFullName());
      153
      assert.eq(cmdRes.cursor.nextBatch.length, 0);
      154
      assert.gte((new Date()) - now,
      155
                 // SERVER-31502 Add some leniency here since our server-side wait may be woken up
      156
                 // spuriously.
      157
                 3900,
      158
                 "Insert not matching filter caused awaitData getMore to return prematurely.");
      159
      insertshell();
      

      Attachments

        Activity

          People

            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: