[SERVER-29519] Get rid of getGlobalReplicationCoordinator Created: 08/Jun/17 Updated: 30/Oct/23 Resolved: 02/Mar/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 3.5.9 |
| Fix Version/s: | 3.7.3 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Esha Maharishi (Inactive) | Assignee: | Henrik Edin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Sprint: | Sharding 2017-06-19, Sharding 2017-07-10, Platforms 2018-01-15, Platforms 2018-01-29, Platforms 2018-02-12, Platforms 2018-02-26, Platforms 2018-03-12 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
| Comments |
| Comment by Githook User [ 02/Mar/18 ] |
|
Author: {'email': 'nicholas.zolnierz@mongodb.com', 'name': 'Nick Zolnierz', 'username': 'nzolnierzmdb'}Message: This reverts commit a8fddd07a740e959646995ef93139887b3b3eb5c. |
| Comment by Githook User [ 02/Mar/18 ] |
|
Author: {'email': 'nicholas.zolnierz@mongodb.com', 'name': 'Nick Zolnierz', 'username': 'nzolnierzmdb'}Message: Revert " This reverts commit 7d37a75df3f6035a7afcb51123b88f0e99308fc8. |
| Comment by Githook User [ 02/Mar/18 ] |
|
Author: {'email': 'henrik.edin@mongodb.com', 'name': 'Henrik Edin', 'username': 'henrikedin'}Message: |
| Comment by Githook User [ 02/Mar/18 ] |
|
Author: {'email': 'henrik.edin@mongodb.com', 'name': 'Henrik Edin', 'username': 'henrikedin'}Message: |
| Comment by Henrik Edin [ 02/Feb/18 ] |
|
Still work to do, returning to backlog. |
| Comment by Githook User [ 22/Jan/18 ] |
|
Author: {'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}Message: |
| Comment by Kaloian Manassiev [ 18/Dec/17 ] |
|
It shouldn't be a problem - the number of shards is fairly small. |
| Comment by Henrik Edin [ 18/Dec/17 ] |
|
The commands doesn't use MONGO_INITIALIZER right now, but if we change that then passing the ServiceContext like you suggest would work. We also might not want to initialize commands once per ServiceContext, I don't know if they have any instance specific data they need to store. Even if we run several instances they could share command registry? For the local shards, yeah it just felt silly to have the same pointer to a ServiceContext all over the place. But perhaps that's not a problem. |
| Comment by Kaloian Manassiev [ 18/Dec/17 ] |
I was thinking about that at the time when I filed this ticket. How about we just start passing the ServiceContext as part of the initializers? That way we can deliver it to the commands by making them be created in initializer blocks?
What do you mean by that - are you concerned about the memory usage? |
| Comment by Henrik Edin [ 18/Dec/17 ] |
|
Most of the places are easy to swap out for repl::ReplicationCoordinator::get but there are some exceptions: Command registration is global and their virtual functions need to pass a ServiceContext (or ReplicationCoordinator). Now they just grab whatever globals they might need. ExportedServerParameter is also registered globally, they probably need to be registered in a ServiceContext so different instances can have their separate parameters. LocalShard is also getting the global replication coordinator to access some config. Need to figure how this mechanism should look like. We might have lots of shards so a back pointer might not be the most efficient way of doing it, but passing a ServiceContext to the (all) interface(s) is not very elegant either. |