summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2014-04-28 13:58:58 -0400
committerRandolph Tan <randolph@10gen.com>2014-09-16 11:57:18 -0400
commit6b1bbcefe2592f5c1e8ce2ae81ad40fca68c54a0 (patch)
treef9f48402594200e827ec9fe30ac8af71f2d90d84
parentf46ea38b7f63987e7041a4c07ce8eea3b7b46f71 (diff)
downloadmongo-6b1bbcefe2592f5c1e8ce2ae81ad40fca68c54a0.tar.gz
SERVER-13770 Helpers::removeRange should check all runner states
(cherry picked from commit 94ff38a9c47047f0f86fd1ae2bbfa1f3a201aa6e) Conflicts: src/mongo/db/dbhelpers.cpp
-rw-r--r--src/mongo/db/dbhelpers.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index 48677c5f218..6a6156b8723 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -38,6 +38,7 @@
#include "mongo/client/dbclientinterface.h"
#include "mongo/db/db.h"
+#include "mongo/db/exec/working_set_common.h"
#include "mongo/db/json.h"
#include "mongo/db/index/btree_access_method.h"
#include "mongo/db/ops/delete.h"
@@ -387,6 +388,23 @@ namespace mongo {
runner.reset();
if (Runner::RUNNER_EOF == state) { break; }
+ if (Runner::RUNNER_DEAD == state) {
+ warning() << "cursor died: aborting deletion for "
+ << min << " to " << max << " in " << ns
+ << endl;
+ break;
+ }
+
+ if (Runner::RUNNER_ERROR == state) {
+ warning() << "cursor error while trying to delete "
+ << min << " to " << max
+ << " in " << ns << ": "
+ << WorkingSetCommon::toStatusString(obj) << endl;
+ break;
+ }
+
+ verify(Runner::RUNNER_ADVANCED == state);
+
int newYieldCount = c.curop()->numYields();
if (oldYieldCount != newYieldCount && !_isMaster()) {
warning() << "current node is not primary anymore, "