ShardRegistry::getShard should return a StatusWith<shared_ptr<Shard>>

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • 3.3.12
    • Affects Version/s: None
    • Component/s: Sharding
    • Fully Compatible
    • Sharding 2016-08-29
    • 0
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Misha Tyulenev (Inactive)
              Reporter:
              Spencer Brody (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: