summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2015-11-06 10:32:04 -0500
committerDavid Storch <david.storch@10gen.com>2015-11-06 10:32:10 -0500
commit3bd1d8bb96dae6c780ea451cc1dc60794188a69b (patch)
tree8c5500782b1cef914de144ebdf05bc22b53f46ab
parentc980c02f219e595279e2b81f558ec1c81e841573 (diff)
downloadmongo-3bd1d8bb96dae6c780ea451cc1dc60794188a69b.tar.gz
SERVER-21227 don't drop invalidated results in the MultiPlanRunner
-rw-r--r--src/mongo/db/query/multi_plan_runner.cpp30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/mongo/db/query/multi_plan_runner.cpp b/src/mongo/db/query/multi_plan_runner.cpp
index 002b3ebac62..e14d03cc984 100644
--- a/src/mongo/db/query/multi_plan_runner.cpp
+++ b/src/mongo/db/query/multi_plan_runner.cpp
@@ -149,35 +149,19 @@ namespace mongo {
if (NULL != _bestPlan) {
_bestPlan->invalidate(dl, type);
for (list<WorkingSetID>::iterator it = _alreadyProduced.begin();
- it != _alreadyProduced.end();) {
+ it != _alreadyProduced.end(); ++it) {
WorkingSetMember* member = _bestPlan->getWorkingSet()->get(*it);
if (member->hasLoc() && member->loc == dl) {
- list<WorkingSetID>::iterator next = it;
- next++;
WorkingSetCommon::fetchAndInvalidateLoc(member);
- _bestPlan->getWorkingSet()->flagForReview(*it);
- _alreadyProduced.erase(it);
- it = next;
- }
- else {
- it++;
}
}
if (NULL != _backupPlan) {
_backupPlan->invalidate(dl, type);
for (list<WorkingSetID>::iterator it = _backupAlreadyProduced.begin();
- it != _backupAlreadyProduced.end();) {
+ it != _backupAlreadyProduced.end(); ++it) {
WorkingSetMember* member = _backupPlan->getWorkingSet()->get(*it);
if (member->hasLoc() && member->loc == dl) {
- list<WorkingSetID>::iterator next = it;
- next++;
WorkingSetCommon::fetchAndInvalidateLoc(member);
- _backupPlan->getWorkingSet()->flagForReview(*it);
- _backupAlreadyProduced.erase(it);
- it = next;
- }
- else {
- it++;
}
}
}
@@ -186,18 +170,10 @@ namespace mongo {
for (size_t i = 0; i < _candidates.size(); ++i) {
_candidates[i].root->invalidate(dl, type);
for (list<WorkingSetID>::iterator it = _candidates[i].results.begin();
- it != _candidates[i].results.end();) {
+ it != _candidates[i].results.end(); ++it) {
WorkingSetMember* member = _candidates[i].ws->get(*it);
if (member->hasLoc() && member->loc == dl) {
- list<WorkingSetID>::iterator next = it;
- next++;
WorkingSetCommon::fetchAndInvalidateLoc(member);
- _candidates[i].ws->flagForReview(*it);
- _candidates[i].results.erase(it);
- it = next;
- }
- else {
- it++;
}
}
}