summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2014-12-04 16:27:31 -0500
committerDavid Storch <david.storch@10gen.com>2014-12-05 10:29:32 -0500
commit2dc85453cee5fdc0312c44a2f0633be9f23e7ca0 (patch)
treef857f96bd115bea790a85d38a29d96c89726b501 /src/mongo/db
parent5a0d148ffd2db70901eb0cdbeaf159b77bc1fc91 (diff)
downloadmongo-2dc85453cee5fdc0312c44a2f0633be9f23e7ca0.tar.gz
SERVER-15812 Rename PlanExecutor::EXEC_ERROR to PlanExecutor::FAILURE
Done in order to be consistent with PlanStage::StageState. Also cleans up use of PlanStage::DEAD in the IDHackStage.
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/commands/collection_to_capped.cpp2
-rw-r--r--src/mongo/db/commands/group.cpp2
-rw-r--r--src/mongo/db/dbhelpers.cpp2
-rw-r--r--src/mongo/db/exec/idhack.cpp5
-rw-r--r--src/mongo/db/exec/idhack.h3
-rw-r--r--src/mongo/db/pipeline/document_source_cursor.cpp2
-rw-r--r--src/mongo/db/query/find.cpp6
-rw-r--r--src/mongo/db/query/plan_executor.cpp8
-rw-r--r--src/mongo/db/query/plan_executor.h2
9 files changed, 13 insertions, 19 deletions
diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp
index 19b961a3e52..6cda6aa1c3a 100644
--- a/src/mongo/db/commands/collection_to_capped.cpp
+++ b/src/mongo/db/commands/collection_to_capped.cpp
@@ -105,7 +105,7 @@ namespace {
case PlanExecutor::DEAD:
db->dropCollection( txn, toNs );
return Status( ErrorCodes::InternalError, "executor turned dead while iterating" );
- case PlanExecutor::EXEC_ERROR:
+ case PlanExecutor::FAILURE:
return Status( ErrorCodes::InternalError, "executor error while iterating" );
case PlanExecutor::ADVANCED:
if ( excessSize > 0 ) {
diff --git a/src/mongo/db/commands/group.cpp b/src/mongo/db/commands/group.cpp
index 654ff73001b..08a7701b7a7 100644
--- a/src/mongo/db/commands/group.cpp
+++ b/src/mongo/db/commands/group.cpp
@@ -153,7 +153,7 @@ namespace mongo {
BSONObj retval;
PlanExecutor::ExecState state = planExecutor->getNext(&retval, NULL);
if (PlanExecutor::ADVANCED != state) {
- if (PlanExecutor::EXEC_ERROR == state &&
+ if (PlanExecutor::FAILURE == state &&
WorkingSetCommon::isValidStatusMemberObject(retval)) {
return appendCommandStatus(out, WorkingSetCommon::getMemberObjectStatus(retval));
}
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index ad9e5c60a15..e6258c23a2c 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -403,7 +403,7 @@ namespace mongo {
break;
}
- if (PlanExecutor::EXEC_ERROR == state) {
+ if (PlanExecutor::FAILURE == state) {
warning(LogComponent::kSharding) << "cursor error while trying to delete "
<< min << " to " << max
<< " in " << ns << ": "
diff --git a/src/mongo/db/exec/idhack.cpp b/src/mongo/db/exec/idhack.cpp
index 8a220eba97f..f3d97f16527 100644
--- a/src/mongo/db/exec/idhack.cpp
+++ b/src/mongo/db/exec/idhack.cpp
@@ -50,7 +50,6 @@ namespace mongo {
_collection(collection),
_workingSet(ws),
_key(query->getQueryObj()["_id"].wrap()),
- _killed(false),
_done(false),
_idBeingPagedIn(WorkingSet::INVALID_ID),
_commonStats(kStageType) {
@@ -68,7 +67,6 @@ namespace mongo {
_collection(collection),
_workingSet(ws),
_key(key),
- _killed(false),
_done(false),
_addKeyMetadata(false),
_idBeingPagedIn(WorkingSet::INVALID_ID),
@@ -83,7 +81,7 @@ namespace mongo {
return false;
}
- return _killed || _done;
+ return _done;
}
PlanStage::StageState IDHackStage::work(WorkingSetID* out) {
@@ -92,7 +90,6 @@ namespace mongo {
// Adds the amount of time taken by work() to executionTimeMillis.
ScopedTimer timer(&_commonStats.executionTimeMillis);
- if (_killed) { return PlanStage::DEAD; }
if (_done) { return PlanStage::IS_EOF; }
if (WorkingSet::INVALID_ID != _idBeingPagedIn) {
diff --git a/src/mongo/db/exec/idhack.h b/src/mongo/db/exec/idhack.h
index a58d0fc393f..800cd8e4675 100644
--- a/src/mongo/db/exec/idhack.h
+++ b/src/mongo/db/exec/idhack.h
@@ -94,9 +94,6 @@ namespace mongo {
// The value to match against the _id field.
BSONObj _key;
- // Did someone call kill() on us?
- bool _killed;
-
// Have we returned our one document?
bool _done;
diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp
index 90c285faff8..a0a40eae812 100644
--- a/src/mongo/db/pipeline/document_source_cursor.cpp
+++ b/src/mongo/db/pipeline/document_source_cursor.cpp
@@ -120,7 +120,7 @@ namespace mongo {
state != PlanExecutor::DEAD);
uassert(17285, "cursor encountered an error: " + WorkingSetCommon::toStatusString(obj),
- state != PlanExecutor::EXEC_ERROR);
+ state != PlanExecutor::FAILURE);
massert(17286, str::stream() << "Unexpected return from PlanExecutor::getNext: " << state,
state == PlanExecutor::IS_EOF || state == PlanExecutor::ADVANCED);
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp
index 4227e8f229f..aa2d635c294 100644
--- a/src/mongo/db/query/find.cpp
+++ b/src/mongo/db/query/find.cpp
@@ -329,9 +329,9 @@ namespace mongo {
// to getNext(...) might just return EOF).
bool saveClientCursor = false;
- if (PlanExecutor::DEAD == state || PlanExecutor::EXEC_ERROR == state) {
+ if (PlanExecutor::DEAD == state || PlanExecutor::FAILURE == state) {
// Propagate this error to caller.
- if (PlanExecutor::EXEC_ERROR == state) {
+ if (PlanExecutor::FAILURE == state) {
scoped_ptr<PlanStageStats> stats(exec->getStats());
error() << "Plan executor error, stats: "
<< Explain::statsToBSON(*stats);
@@ -755,7 +755,7 @@ namespace mongo {
exec->deregisterExec();
// Caller expects exceptions thrown in certain cases.
- if (PlanExecutor::EXEC_ERROR == state) {
+ if (PlanExecutor::FAILURE == state) {
scoped_ptr<PlanStageStats> stats(exec->getStats());
error() << "Plan executor error, stats: "
<< Explain::statsToBSON(*stats);
diff --git a/src/mongo/db/query/plan_executor.cpp b/src/mongo/db/query/plan_executor.cpp
index 2dc8a7db2e2..796523470d1 100644
--- a/src/mongo/db/query/plan_executor.cpp
+++ b/src/mongo/db/query/plan_executor.cpp
@@ -201,8 +201,8 @@ namespace mongo {
return "DEAD";
}
else {
- verify(PlanExecutor::EXEC_ERROR == s);
- return "EXEC_ERROR";
+ verify(PlanExecutor::FAILURE == s);
+ return "FAILURE";
}
}
@@ -355,7 +355,7 @@ namespace mongo {
if (NULL != objOut) {
WorkingSetCommon::getStatusMemberObject(*_workingSet, id, objOut);
}
- return PlanExecutor::EXEC_ERROR;
+ return PlanExecutor::FAILURE;
}
}
}
@@ -403,7 +403,7 @@ namespace mongo {
if (PlanExecutor::DEAD == state) {
return Status(ErrorCodes::OperationFailed, "Exec error: PlanExecutor killed");
}
- else if (PlanExecutor::EXEC_ERROR == state) {
+ else if (PlanExecutor::FAILURE == state) {
return Status(ErrorCodes::OperationFailed,
str::stream() << "Exec error: "
<< WorkingSetCommon::toStatusString(obj));
diff --git a/src/mongo/db/query/plan_executor.h b/src/mongo/db/query/plan_executor.h
index 9f2d0f9ed0d..eecfb6efe09 100644
--- a/src/mongo/db/query/plan_executor.h
+++ b/src/mongo/db/query/plan_executor.h
@@ -71,7 +71,7 @@ namespace mongo {
// If the underlying PlanStage has any information on the error, it will be available in
// the objOut parameter. Call WorkingSetCommon::toStatusString() to retrieve the error
// details from the output BSON object.
- EXEC_ERROR,
+ FAILURE,
};
/**