[SERVER-45983] Perform the shardVersion recovery and refresh on a separate thread from that of the user request Created: 05/Feb/20  Updated: 29/Oct/23  Resolved: 09/Jun/20

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

Type: Task Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Pierlauro Sciarelli
Resolution: Fixed Votes: 0
Labels: PM-1645-Milestone-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-47975 Optimize ScopedShardVersionCriticalSe... Closed
depends on SERVER-47985 Implement recovery of a shard's `shar... Closed
Related
related to SERVER-48198 Migration recovery may recover incorr... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-04-06, Sharding 2020-05-04, Sharding 2020-05-18, Sharding 2020-06-01, Sharding 2020-06-15
Participants:
Linked BF Score: 57

 Description   

The sharding migration commit protocol does not perform a proper 2-phase commit in order to have the minimum possible latency impact in the steady state. Because of this, the following theoretical sequence of events is possible:

  • The current primary of a shard is just about to commit migration against the config server
  • A new primary is elected, which refreshes from the config server before the commit from the previous primary has reached it
  • The new primary sees old shardVersion (and as a result also filtering metadata) and incorrectly accepts writes which are supposed to go to a different shard

The RangeDeleter project implemented a command to bump a chunk's shard version and also added a check for chunk version equality as part of the migration commit. We should package that logic into an asynchronous task and make sure that forceFilteringMetadataRefresh executes that recovery logic before accepting the shardVersion returned from the config server.



 Comments   
Comment by Xgen-Evergreen-User [ 09/Jun/20 ]

Evergreen version 5edf5fb41e2d17045658dd16 in 'mongodb-mongo-master' has succeeded!

Comment by Githook User [ 09/Jun/20 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-45983 Perform the shardVersion recovery and refresh on a separate thread from that of the user request
Branch: master
https://github.com/mongodb/mongo/commit/dd7e51f1a8512802829ac92921fed0b0c74f6548

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