[SERVER-23930] Race condition between addShard and ShardRegistry reload Created: 26/Apr/16  Updated: 21/Nov/16  Resolved: 26/Apr/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.2.5, 3.3.5
Fix Version/s: 3.2.8, 3.3.6

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: code-and-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Participants:
Linked BF Score: 0

 Description   

If one thread starts reloading the shard registry, all other calls to reload will block waiting for it to complete. If addShard runs concurrently with the reload, it is possible that the initial reload will not see the newly added shard and the reload initiated by addShard will do nothing, assuming that the first reload saw the latest state.

This is a race condition, which can cause shardCollection calls with sharded key to not use newly added shards.



 Comments   
Comment by Githook User [ 24/Jun/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-23930 Ensure new shard is available in the ShardRegistry after addShard
Branch: v3.2
https://github.com/mongodb/mongo/commit/5e352923ca2c04e85efd4ed65c1448dbb6e15f2d

Comment by Githook User [ 24/Jun/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-23930 Ensure new shard is available in the ShardRegistry after addShard"

This reverts commit 13b915aac8cbdceb4fee6b972dbd821003d9d5e2.
Branch: v3.2
https://github.com/mongodb/mongo/commit/e9746acfea16d422d6f94e878a670496ca0f916c

Comment by Githook User [ 24/Jun/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-23930 Ensure new shard is available in the ShardRegistry after addShard

Backported commit c2538292d6e731366b8c53cd04efe3a035738ab9.
Branch: v3.2
https://github.com/mongodb/mongo/commit/13b915aac8cbdceb4fee6b972dbd821003d9d5e2

Comment by Githook User [ 26/Apr/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-23930 Ensure new shard is available in the ShardRegistry after addShard
Branch: master
https://github.com/mongodb/mongo/commit/c2538292d6e731366b8c53cd04efe3a035738ab9

Comment by Githook User [ 26/Apr/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-23930 Ensure new shard is available in the ShardRegistry after addShard"

This reverts commit 6dfaea7ca3e29e421a86420de20fa11cdae690b6.
Branch: master
https://github.com/mongodb/mongo/commit/6691776481079f59af652f2c7162f7a5df968086

Comment by Githook User [ 26/Apr/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-23930 Ensure new shard is available in the ShardRegistry after addShard
Branch: master
https://github.com/mongodb/mongo/commit/6dfaea7ca3e29e421a86420de20fa11cdae690b6

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