summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/merge_sort.cpp
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2014-10-20 18:38:32 -0400
committerJason Rassi <rassi@10gen.com>2014-11-20 12:52:25 -0500
commit4c221b5ce50c3eaabc0348432b6df6c41aeabee5 (patch)
treea2093f79d0409087c2ef4ac3e610da20dc663bbe /src/mongo/db/exec/merge_sort.cpp
parent429dc5819eb37e21d9e5c4573aae8421efd50ed7 (diff)
downloadmongo-4c221b5ce50c3eaabc0348432b6df6c41aeabee5.tar.gz
SERVER-15675 PlanStage::invalidate() needs OperationContext
PlanStage::invalidate() is always called by a different thread than the stage's owning thread. The method should use the active OperationContext (the caller's) rather than the stage's OperationContext.
Diffstat (limited to 'src/mongo/db/exec/merge_sort.cpp')
-rw-r--r--src/mongo/db/exec/merge_sort.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mongo/db/exec/merge_sort.cpp b/src/mongo/db/exec/merge_sort.cpp
index 6c39f2f3615..f30991aeaba 100644
--- a/src/mongo/db/exec/merge_sort.cpp
+++ b/src/mongo/db/exec/merge_sort.cpp
@@ -38,12 +38,10 @@ namespace mongo {
// static
const char* MergeSortStage::kStageType = "SORT_MERGE";
- MergeSortStage::MergeSortStage(OperationContext* txn,
- const MergeSortStageParams& params,
+ MergeSortStage::MergeSortStage(const MergeSortStageParams& params,
WorkingSet* ws,
const Collection* collection)
- : _txn(txn),
- _collection(collection),
+ : _collection(collection),
_ws(ws),
_pattern(params.pattern),
_dedup(params.dedup),
@@ -198,17 +196,18 @@ namespace mongo {
}
void MergeSortStage::restoreState(OperationContext* opCtx) {
- _txn = opCtx;
++_commonStats.unyields;
for (size_t i = 0; i < _children.size(); ++i) {
_children[i]->restoreState(opCtx);
}
}
- void MergeSortStage::invalidate(const DiskLoc& dl, InvalidationType type) {
+ void MergeSortStage::invalidate(OperationContext* txn,
+ const DiskLoc& dl,
+ InvalidationType type) {
++_commonStats.invalidates;
for (size_t i = 0; i < _children.size(); ++i) {
- _children[i]->invalidate(dl, type);
+ _children[i]->invalidate(txn, dl, type);
}
// Go through our data and see if we're holding on to the invalidated loc.
@@ -216,7 +215,7 @@ namespace mongo {
WorkingSetMember* member = _ws->get(valueIt->id);
if (member->hasLoc() && (dl == member->loc)) {
// Force a fetch and flag. We could possibly merge this result back in later.
- WorkingSetCommon::fetchAndInvalidateLoc(_txn, member, _collection);
+ WorkingSetCommon::fetchAndInvalidateLoc(txn, member, _collection);
_ws->flagForReview(valueIt->id);
++_specificStats.forcedFetches;
}