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

Handle addShard event with the change collection

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Execution

      PM-2334 introduced change collection to read change events from the change collection in the serverless. The change collection at the moment cannot replay the change events after the addShard event, ie. after the addShard is done, the change collection cannot replay the change stream with a previous resume token.

      For eg., this case will not work with the change collection.

      const csCursor = db.coll.watch();
      const resumeToken = csCursor.getResumeToken();
      db.coll.insert({_id: 1});
      assert.soon(() => csCursor.next());
      // validate event.
      
      // Add a new node to the shared cluster.
      
      // Now open the change stream cursor again using the resume token 'resumeToken'.
      const newCsCursor = db.coll.watch([], {resumeAfter: resumeToken});
      
      // Opening the change stream cursor will now throw - change stream cannot be resumed error.
       

      The entire history can be found here: https://github.com/10gen/mongo/pull/6377

       

      This ticket is about handling the mentioned issue. After fixing the issue the test case - change_stream_resume_before_add_shard should work with the change collection.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            rishab.joshi@mongodb.com Rishab Joshi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: