-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Sharding
-
Sharding EMEA
-
Fully Compatible
-
ALL
-
15
The following sequence of events can lead _shardsvrShardCollection to return ok:1 without actually writing chunks if a user follows the recommended procedure for handling a ManualInterventionRequired error:
- Config primary sends _shardsvrShardCollection to primary shard primary node
- Primary shard writes chunks to config.chunks with majority write concern
- Primary shard steps down immediately after sending config.collections update to config server
- Config primary retries _shardsvrShardCollection on new primary shard (because of this idempotent retry policy) primary node before the config.collections update arrives or is majority committed
- Primary shard reads from config.collections with majority read concern and continues with sharding the collection because it does not see the config.collections write
- Primary shard throws ManualInterventionRequired when it finds chunks already exist for the namespace (from the first attempt)
- A user deletes the namespace's chunks before retrying shardCollection
- Config primary sends _shardsvrShardCollection to primary shard primary node
- Primary shard reads config.collections after the write from the first attempt is majority committed, assumes the collection is sharded, and returns ok:1, leaving the collection without any chunks