summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/move_timing_helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/move_timing_helper.cpp')
-rw-r--r--src/mongo/db/s/move_timing_helper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/s/move_timing_helper.cpp b/src/mongo/db/s/move_timing_helper.cpp
index 8eca70419e2..f62adc83956 100644
--- a/src/mongo/db/s/move_timing_helper.cpp
+++ b/src/mongo/db/s/move_timing_helper.cpp
@@ -47,6 +47,7 @@ MoveTimingHelper::MoveTimingHelper(OperationContext* opCtx,
const boost::optional<BSONObj>& min,
const boost::optional<BSONObj>& max,
int totalNumSteps,
+ std::string* cmdErrmsg,
const ShardId& toShard,
const ShardId& fromShard)
: _opCtx(opCtx),
@@ -57,6 +58,7 @@ MoveTimingHelper::MoveTimingHelper(OperationContext* opCtx,
_min(min),
_max(max),
_totalNumSteps(totalNumSteps),
+ _cmdErrmsg(cmdErrmsg),
_nextStep(0) {}
MoveTimingHelper::~MoveTimingHelper() {
@@ -80,8 +82,8 @@ MoveTimingHelper::~MoveTimingHelper() {
_b.append("note", "success");
}
- if (!_cmdErrmsg.empty()) {
- _b.append("errmsg", _cmdErrmsg);
+ if (!_cmdErrmsg->empty()) {
+ _b.append("errmsg", *_cmdErrmsg);
}
ShardingLogging::get(_opCtx)->logChange(_opCtx,