[SERVER-54701] shardCollection might succesfully write to the config server but end up with missing indexes on the primary Shard Created: 22/Feb/21  Updated: 29/Oct/23  Resolved: 23/Mar/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 4.4.4
Fix Version/s: 4.4.5

Type: Bug Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

1. The shard index is created locally
2. The writes to config.chunks and config.collections are sent to the config server
3. A stepdown happens
4. The index creation is rolled backed

Sprint: Sharding 2021-03-22, Sharding 2021-04-05
Participants:

 Description   

The index creation on the shard collection path is performed using a DBClient, which does not wait for majority write concern. The following scenario might happen:

1. The shard index is created locally
2. The writes to config.chunks and config.collections are sent to the config server
3. A stepdown happens
4. The index creation is rolled backed

If the write on step two succeeds then we'll end up with a sharded collection without the sharded index created on the primary. We should wait for majority write concern of the latest write after the index creation (probably using the same as the sharding catalog manager)



 Comments   
Comment by Githook User [ 23/Mar/21 ]

Author:

{'name': 'Marcos José Grillo Ramirez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-54701 Wait for majority write concern after shard index creation
Branch: v4.4
https://github.com/mongodb/mongo/commit/37b8886db6b9e1df473c1b6b90142641b73f87f9

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