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

Using multiple changeStream cursors causes a segfault

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.5.11
    • 3.5.12
    • Replication
    • None
    • Fully Compatible
    • ALL
    • Hide

      Open the shell and call next() on two changeStream cursors. Code example in the description.

      Show
      Open the shell and call next() on two changeStream cursors. Code example in the description.
    • Repl 2017-08-21

    Description

      When running on 3.5.11 or nightly the following code run in the shell causes the primary node to segfault.

      use testChangeStreams;
      db.dropDatabase();
       
      // Example 1
      print("1. First cursor value: ");
      db.changes.insertOne({test: "a"});
      var cursor1 = db.changes.aggregate([ { $changeStream: { fullDocument: "none"} } ]);
       
      var next = null;
      if (cursor1.hasNext()) {
          next = cursor1.next();
      }
      printjson(next);
       
      // Example 2
      print("2. Lookup enabled: ");
      var cursor2 = db.changes.aggregate([{$changeStream: {fullDocument: "lookup"} }]);
       
      while (cursor2.hasNext()) {
          next = cursor2.next();
      }
      db.changes.updateOne({test: "a"}, {$set: {test: "b"}});
      next = cursor2.next();  // Segfaults
      printjson(next);
      

      (If testing on 3.5.11 change the aggregation to be $changeNotification).

      Attachments

        Issue Links

          Activity

            People

              matthew.russotto@mongodb.com Matthew Russotto
              ross@mongodb.com Ross Lawley
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: