diff options
Diffstat (limited to 'src/mongo/db/s/migration_source_manager.cpp')
-rw-r--r-- | src/mongo/db/s/migration_source_manager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/db/s/migration_source_manager.cpp b/src/mongo/db/s/migration_source_manager.cpp index 043d72a9644..93657eb1481 100644 --- a/src/mongo/db/s/migration_source_manager.cpp +++ b/src/mongo/db/s/migration_source_manager.cpp @@ -40,6 +40,7 @@ #include "mongo/db/db_raii.h" #include "mongo/db/dbhelpers.h" #include "mongo/db/exec/plan_stage.h" +#include "mongo/db/exec/working_set_common.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/operation_context.h" #include "mongo/db/query/internal_plans.h" @@ -433,8 +434,10 @@ bool MigrationSourceManager::storeCurrentLocs(OperationContext* txn, bool isLargeChunk = false; unsigned long long recCount = 0; + BSONObj obj; RecordId recordId; - while (PlanExecutor::ADVANCED == exec->getNext(NULL, &recordId)) { + PlanExecutor::ExecState state; + while (PlanExecutor::ADVANCED == (state = exec->getNext(&obj, &recordId))) { if (!isLargeChunk) { stdx::lock_guard<stdx::mutex> lk(_cloneLocsMutex); _cloneLocs.insert(recordId); @@ -447,6 +450,12 @@ bool MigrationSourceManager::storeCurrentLocs(OperationContext* txn, } } + if (PlanExecutor::DEAD == state || PlanExecutor::FAILURE == state) { + errmsg = "Executor error while scanning for documents belonging to chunk: " + + WorkingSetCommon::toStatusString(obj); + return false; + } + exec.reset(); if (isLargeChunk) { |