[SERVER-51523] Don't attempt to retrieve a ReshardingCoordinator instance on a replica set secondary Created: 13/Oct/20 Updated: 29/Oct/23 Resolved: 19/Oct/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Blake Oler | Assignee: | Janna Golden |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | PM-234-M1, PM-234-T-lifecycle | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Sprint: | Sharding 2020-10-19, Sharding 2020-11-02 | ||||||||
| Participants: | |||||||||
| Description |
|
When a PrimaryOnlyService service exists on a replica set secondary, it will be in state kPaused. On a primary, it will be in state kRunning. If one attempts to retrieve an instance while the service is in kPaused, the returned instance will be a boost::none. OpObservers are run on both primaries and secondaries. This becomes an issue when attempting to run the ReshardingOpObserver, particularly here.. We should prepend a call to PrimaryOnlyService::isRunning() to verify that the PrimaryOnlyService is running before trying to retrieve the instance. Furthermore, we should check if the boost::optional is initialized and throw a DBException anyway, because attempting to index into an uninitialized boost::optional will create a segfault. |
| Comments |
| Comment by Githook User [ 19/Oct/20 ] | ||||||
|
Author: {'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}Message: | ||||||
| Comment by Blake Oler [ 14/Oct/20 ] | ||||||
|
From max.hirschhorn in Slack, he could see it being done this way:
|