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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc7, 3.7.1
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6

      Description

      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
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              charlie.swanson Charlie Swanson
              Reporter:
              shane.harvey Shane Harvey
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: