[SERVER-74716] Prevent "back-in-time" change stream resume token on MongoS Created: 09/Mar/23  Updated: 29/Oct/23  Resolved: 27/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0, 6.0.7

Type: Bug Priority: Major - P3
Reporter: Romans Kasperovics Assignee: Romans Kasperovics
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-75068 Refactor change stream helpers and co... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0
Sprint: QE 2023-03-20, QE 2023-04-03
Participants:

 Description   

mongoS will crash with an invariant failure when:

  1. The initial resume token expected by mongoS is the split event fragment.
  2. On the shards, DSCSCheckResumability lets the base event through expecting it to be split.
  3. But there is no split stage, and the base event is returned to mongoS directly as-is.
  4. But the event's resume token is BEFORE the split, so mongoS has gone back-in-time.


 Comments   
Comment by Githook User [ 11/Jul/23 ]

Author:

{'name': 'Serhii Lysenko', 'email': 'serhii.lysenko@mongodb.com', 'username': 'serhiitea'}

Message: SERVER-71828 Add $changeStreamSplitLargeEvent stage

This change is a part of PM-2677 backport.
It includes the following changes:

Comment by Githook User [ 14/Jun/23 ]

Author:

{'name': 'Romans Kasperovics', 'email': 'romans.kasperovics@mongodb.com', 'username': 'romanskas'}

Message: SERVER-74716 Move resolveResumeTokenFromSpec() into a separate library

Move the resolveResumeTokenFromSpec() function to a separate library,
so that it can be used outside of change_stream_pipeline library.

This change is a part of PM-2677 backport.
Branch: v6.0
https://github.com/mongodb/mongo/commit/997ef16d31e7b535ba0342da8b820944292b714e

Comment by Githook User [ 24/Mar/23 ]

Author:

{'name': 'Romans Kasperovics', 'email': 'romans.kasperovics@mongodb.com', 'username': 'romanskas'}

Message: SERVER-74716 Require splitEvent stage for splitEvent token
Branch: master
https://github.com/mongodb/mongo/commit/0127ea7f63f4fa80a77ca77a306e2a50e73101ac

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