[SERVER-50077] Shard op observer shouldn't mark collection as unsharded on secondaries Created: 03/Aug/20  Updated: 29/Oct/23  Resolved: 04/Aug/20

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

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

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

1. Create a sharded cluster with at least two nodes
2. Shard a collection and make the persistence of the chunk metadata update to fail
3. Step down the primary
4. Check the shard version of the collection on the new primary, it should be unknown

Sprint: Sharding 2020-08-10
Participants:
Linked BF Score: 13

 Description   

SERVER-47809 added extra code that inteded to set the shard version as unsharded on implicit operations, however, it is also setting secondaries shard version as Unsharded, and, if the persistence of the chunk metadata update fails (like for example because of a step down), then secondaries might end with an Unsharded shard version when it should be Unknown.

Additionally if the shard collection fails to refresh, we should make sure the collection metadata is set to Unknown, to prevent having a wrong shard version even though the write succeeded on the config server.



 Comments   
Comment by Githook User [ 04/Aug/20 ]

Author:

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

Message: SERVER-50077 Set unsharded shard version on collection creation only on primary node on the shard op observer and clear the filtering metadata if the shard register update or the refresh fails on shardCollection
Branch: master
https://github.com/mongodb/mongo/commit/71a444f8d9d8cd6841a5e618dcde107334653008

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