[SERVER-29604] Error when resuming change notifications through mongos if there's no exact match on the ResumeToken from any shard Created: 13/Jun/17  Updated: 06/Dec/22  Resolved: 20/Oct/17

Status: Closed
Project: Core Server
Component/s: Replication, Sharding
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Spencer Brody (Inactive) Assignee: Backlog - Replication Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-29141 Add sharding support for merging chan... Closed
Assigned Teams:
Replication
Participants:

 Description   

When you resume change notifications in a sharded system, re-establishing the change notification cursor on each shard will error if the first entry with a resumeToken higher than the one given is the first entry in the oplog. This allows shards to detect if they have rolled off the back of the oplog. In the normal case this is sufficient to ensure that the resumed notification steam will not miss any entries.

If, however, there was some more serious inconsistency in the system (for instance if a user had somehow manually deleted an oplog entry), or the driver had provided an invalid resumeToken that doesn't correspond to any valid oplog entry on any shard, we won't notice this and will resume notifications from whatever op has the closest resumeToken greater than the token provided to the command.

In order to detect these cases, we could have the shard that finds the exact match on the resumeToken add an extra field to its first notification entry. The merge node could then expect exactly one of the shards to include that extra field and error if that is not the case. The merge node would also need to strip out that extra field so it isn't returned to the end user.



 Comments   
Comment by Charlie Swanson [ 20/Oct/17 ]

This was fixed as part of SERVER-29141

Comment by Spencer Brody (Inactive) [ 13/Jun/17 ]

This ticket is strictly a nice-to-have and should not be considered a requirement to complete the change notification project.

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