[SERVER-22797] Calls to ShardRegistry::reload needs to be serialized Created: 22/Feb/16  Updated: 25/Jan/17  Resolved: 25/Feb/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.3.2
Fix Version/s: 3.2.4, 3.3.3

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
Related
is related to SERVER-21911 ShardRegistry::reload can overwrite e... Closed
is related to SERVER-22795 lastVisibleOpTime for committed snaps... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Sharding 11 (03/11/16)
Participants:
Linked BF Score: 0

 Description   

Currently it is possible for multiple threads to call reload and we use the $replData lastVisibleOpTime to disregard older data:

https://github.com/mongodb/mongo/blob/r3.2.0/src/mongo/s/client/shard_registry.cpp#L190-l195

The problem with this is that lastVisibleOpTime gives you the opTime that is guaranteed to include the data you just read. In other words, it is possible for the lastVisibleOpTime to be way newer than the data you read; which also means that it is possible for the returned shard list that was actually older than the currently stored one to have a newer lastVisibleOpTime and override the shard list. This will cause a momentary "shard not found" error until the next reload.



 Comments   
Comment by Githook User [ 25/Feb/16 ]

Author:

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

Message: SERVER-22797 Calls to ShardRegistry::reload needs to be serialized

(cherry picked from commit cf58ea6426f3bfb5dfbc21700c1c46d32a0bbecc)

Conflicts:
src/mongo/s/client/shard_registry.cpp
Branch: v3.2
https://github.com/mongodb/mongo/commit/4c0a65470b7d0efa8104b16e470bf8c6738b17ba

Comment by Githook User [ 24/Feb/16 ]

Author:

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

Message: SERVER-22797 Calls to ShardRegistry::reload needs to be serialized
Branch: master
https://github.com/mongodb/mongo/commit/cf58ea6426f3bfb5dfbc21700c1c46d32a0bbecc

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