[SERVER-34090] Allow resuming change stream when resume token's document key does not contain the shard key Created: 23/Mar/18  Updated: 29/Oct/23  Resolved: 06/Apr/18

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.7.4

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Bernard Gorman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-32085 $changeStream reports incorrect docum... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2018-04-09
Participants:

 Description   

It's possible for a collection to be sharded for some period of time before the shard knows that the collection is sharded. Because of this, it's possible for insert notifications to be generated without the shard key for a period of time after the collection has been sharded.

When the change stream is resumed, it might be resuming on one of these changes, at a future point when the shard knows that the collection is sharded. When this happens, the resume token will not include the full shard key in the documentKey, but the new generated change which we compare the resume token to will. We should allow resuming in this case if the _ids match. This is safe because there must not have been any chunk migrations up until this point (or the shard would have known the collection was sharded, generating shard keys in the documentKey), so the _id should still be unique.



 Comments   
Comment by Githook User [ 06/Apr/18 ]

Author:

{'email': 'bernard.gorman@gmail.com', 'name': 'Bernard Gorman', 'username': 'gormanb'}

Message: SERVER-34090 Allow resuming change stream when resume token's document key does not contain the shard key
Branch: master
https://github.com/mongodb/mongo/commit/41084e8f0fa354a9efc28a354321200e94a2fcf6

Generated at Thu Feb 08 04:35:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.