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

Race condition in awaitdata_getmore_cmd.js

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.6.0-rc4
    • Fix Version/s: 3.6.4, 3.7.3
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6
    • Sprint:
      Query 2018-03-12, Query 2018-03-26
    • Linked BF Score:
      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

            Assignee:
            nicholas.zolnierz Nicholas Zolnierz
            Reporter:
            james.wahlin James Wahlin
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: