[SERVER-20054] Duplicate Key error when trying to start mongos with config rs on empty cluster Created: 19/Aug/15  Updated: 25/Jan/17  Resolved: 01/Sep/15

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.1.6
Fix Version/s: 3.1.8

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

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 9 (09/18/15)
Participants:

 Description   

2015-08-19T16:20:40.491-0400 E SHARDING [mongosMain] Error initializing sharding system: DuplicateKey E11000 duplicate key error collection: config.version index: _id_ dup key: { : 1 }

I suspect that this is caused by SERVER-14322. This can be triggered by multiple mongos trying to start at the same time on an empty cluster and all of them tries to upsert the config.version document at the same time. This was not an issue in the old config servers because we used to take a distributed lock before inserting the new config.version document and now we don't (since writes will be serialized by the primary and only 1 write will win).



 Comments   
Comment by Githook User [ 01/Sep/15 ]

Author:

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

Message: SERVER-20054 Duplicate Key error when trying to start mongos with config rs on empty cluster
Branch: master
https://github.com/mongodb/mongo/commit/fc05f77386b3a3ae9bea4c3c89447947f38b37b9

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