[SERVER-68282] Handle addShard event with the change collection Created: 25/Jul/22  Updated: 23/Jan/23

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Rishab Joshi (Inactive) Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

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.


Generated at Thu Feb 08 06:10:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.