[SERVER-23598] Race in config.version intialization Created: 07/Apr/16  Updated: 25/Jan/17  Resolved: 07/Apr/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.3.4
Fix Version/s: 3.2.10, 3.3.5

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: code-only
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Sharding 13 (04/22/16)
Participants:
Linked BF Score: 0

 Description   

Mongos currently assumes that if it can't find the config.version document and the config.shards is not empty, then the config server metadata is pre v2.4. The problem is that mongos queries the config.version first, and the config.shards later. Which means that another mongos could have inserted the config.version document and populated the config.shards in between the config.version and config.shards query (or alternatively, the secondary would have catched up to that point).



 Comments   
Comment by Githook User [ 18/Aug/16 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-23598 Race in config.version initialization

Avoid the race by reversing the order of the check on config.version and config.shards collection
Branch: v3.2
https://github.com/mongodb/mongo/commit/02080063e74e89e532849b51ecc143bfeb07dd5e

Comment by Githook User [ 07/Apr/16 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-23598 Race in config.version intialization

Removed the check to determine if config metadata is pre v2.4. Now that config servers are required to be replica sets, they are guaranteed to have the metadata that is at least from v3.2.
Branch: master
https://github.com/mongodb/mongo/commit/9effd11e3c725af58abb87137d8d17b8c814371d

Generated at Thu Feb 08 04:03:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.