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

ChangeStream resumeAfter does not work on unsharded collections if there is more than one shard in the system

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0-rc7, 3.7.1
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • ALL
    • v3.6

      Using $changeStreams with resumeAfter appears to be broken on monogs in 3.7.0-39-g4edcb81:

      MongoDB Enterprise mongos> db.version()
      3.7.0-39-g4edcb81
      MongoDB Enterprise mongos> db.test.insert({})
      WriteResult({ "nInserted" : 1 })
      MongoDB Enterprise mongos> db.test.aggregate([{$changeStream: {}}])
      MongoDB Enterprise mongos> var cursor = db.test.aggregate([{$changeStream: {}}])
      MongoDB Enterprise mongos> db.test.insert({})
      WriteResult({ "nInserted" : 1 })
      MongoDB Enterprise mongos> var resumeToken = cursor.next()['_id']
      MongoDB Enterprise mongos> resumeToken
      {
              "_data" : BinData(0,"gloPd0kAAAACRmRfaWQAZFoPd0nqqGI7wBtBMgBaEATw7w4oNGRFy7mutAi7yJnjBA==")
      }
      MongoDB Enterprise mongos> var cursor = db.test.aggregate([{$changeStream: {resumeAfter: resumeToken}}])
      assert: command failed: {
              "ok" : 0,
              "errmsg" : "The resume token UUID does not exist. Has the collection been dropped?",
              "code" : 40615,
              "codeName" : "Location40615",
              "$clusterTime" : {
                      "clusterTime" : Timestamp(1510963081, 1),
                      "signature" : {
                              "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                              "keyId" : NumberLong(0)
                      }
              },
              "operationTime" : Timestamp(1510963080, 1)
      } : aggregate failed
      _getErrorWithCode@src/mongo/shell/utils.js:25:13
      doassert@src/mongo/shell/assert.js:16:14
      assert.commandWorked@src/mongo/shell/assert.js:370:5
      DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1319:5
      @(shell):1:18
      

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: