[SERVER-54948] Calling `shardCollection` after `enableSharding` from a different MongoS is not causally consistent Created: 04/Mar/21  Updated: 29/Oct/23  Resolved: 26/Jul/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.0.2, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Pierlauro Sciarelli
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-54949 The `enableSharding` then `shardColle... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Sharding EMEA 2021-07-26
Participants:

 Description   

The enableSharding operation just enables the sharded:true bit on the entry for a specific database, but doesn't bump the database version, nor involves the database primary. This means that calling enableSharding from one MongoS and then performing shardCollection through another may cause the DB Primary executing the shardCollection procedure to not see the field enabled and fail the operation.

This used to work when shardCollection executed on the config server, because it was always the primary, but now that it runs on the DB Primary, this is no longer guaranteed.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 27/Jul/21 ]

Author:

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

Message: SERVER-54948 Calling `shardCollection` after `enableSharding` from a different MongoS is not causally consistent
Branch: v5.0
https://github.com/mongodb/mongo/commit/adfd6ac829be8911de859d300262bf77fb0e8438

Comment by Githook User [ 26/Jul/21 ]

Author:

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

Message: SERVER-54948 Calling `shardCollection` after `enableSharding` from a different MongoS is not causally consistent
Branch: master
https://github.com/mongodb/mongo/commit/218536b7a98c7fc05f164db209d0634b2cba4c9c

Comment by Pierlauro Sciarelli [ 13/Jul/21 ]

This has unintentionally been fixed under SERVER-54587 that added a refresh in case the db doesn't seem to be sharded.

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