diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2016-03-03 17:36:24 -0500 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2016-03-03 17:36:24 -0500 |
commit | b3ca937033e8794a670df9d1412dad9716d1eca0 (patch) | |
tree | 366ae1aaf245c49fa5ef64471cd7eb37176c5556 /src/mongo/s | |
parent | c434529e96a200aaa259b8fe9a62e902704791f6 (diff) | |
download | mongo-b3ca937033e8794a670df9d1412dad9716d1eca0.tar.gz |
SERVER-22535 Migration source manager checks for PlanExecutor errors during initial index scan for documents to clone
Diffstat (limited to 'src/mongo/s')
-rw-r--r-- | src/mongo/s/d_migrate.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mongo/s/d_migrate.cpp b/src/mongo/s/d_migrate.cpp index b492c0e8b18..75fa610e5e0 100644 --- a/src/mongo/s/d_migrate.cpp +++ b/src/mongo/s/d_migrate.cpp @@ -54,6 +54,7 @@ #include "mongo/db/commands.h" #include "mongo/db/dbhelpers.h" #include "mongo/db/dur.h" +#include "mongo/db/exec/working_set_common.h" #include "mongo/db/field_parser.h" #include "mongo/db/hasher.h" #include "mongo/db/jsobj.h" @@ -434,8 +435,10 @@ namespace mongo { // we want the number of records to better report, in that case bool isLargeChunk = false; unsigned long long recCount = 0;; + BSONObj obj; DiskLoc dl; - while (Runner::RUNNER_ADVANCED == runner->getNext(NULL, &dl)) { + Runner::RunnerState state; + while (Runner::RUNNER_ADVANCED == (state = runner->getNext(&obj, &dl))) { if ( ! isLargeChunk ) { scoped_spinlock lk( _trackerLocks ); _cloneLocs.insert( dl ); @@ -445,6 +448,18 @@ namespace mongo { isLargeChunk = true; } } + + if (Runner::RUNNER_DEAD == state) { + errmsg = "Runner error while scanning for documents belonging to chunk."; + return false; + } + + if (Runner::RUNNER_ERROR == state) { + errmsg = "Runner error while scanning for documents belonging to chunk: " + + WorkingSetCommon::toStatusString(obj); + return false; + } + runner.reset(); if ( isLargeChunk ) { |