[SERVER-23996] ShardRegistry::getShard should return a StatusWith<shared_ptr<Shard>> Created: 29/Apr/16 Updated: 02/Sep/16 Resolved: 25/Aug/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 3.3.12 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Misha Tyulenev |
| Resolution: | Done | Votes: | 0 |
| Labels: | PM550 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Sprint: | Sharding 2016-08-29 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||
| Description |
|
Currently every place that calls ShardRegistry::getShard has to check to make sure the pointer it gets back isn't null, and if it is it usually then constructs a Status with the ShardNotFound code to report that. It would be clearer and less error prone if we just returned a StatusWith, making the fact that getShard can fail to actually get a shard explicit, and less likely that a caller forgets to check and accidentally dereferences a null pointer. |
| Comments |
| Comment by Githook User [ 25/Aug/16 ] |
|
Author: {u'username': u'mikety', u'name': u'Misha Tyulenev', u'email': u'misha@mongodb.com'}Message: |