Details
Description
When a shard is a donor and a recipient, it is possible to get into a state with a currentOp instance without one of donorState or recipientState set. Currently resharding metrics does not account for this and tries to dereference the uninitialized boost::optional for donorState/recipientState causing a failure when building a currentOp report. To fix this, we can check whether donorState/recipientState are uninitialized and if so, use kUnused as the state to build the currentOp report.