diff options
author | Mathias Stearn <mathias@10gen.com> | 2015-07-06 19:16:30 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2015-07-16 14:37:02 -0400 |
commit | b9d2e18ca68246e5d21ed42a846ff4094867f159 (patch) | |
tree | cdbbac6dc5ee00404cf6452f5dd70612983127e3 /src/mongo/db/exec/idhack.cpp | |
parent | c832bc753c29f91597b75fa02c0d9019c3c20b0f (diff) | |
download | mongo-b9d2e18ca68246e5d21ed42a846ff4094867f159.tar.gz |
SERVER-17364 Don't stash RecoveryUnits across getMores
We now tell PlanExecutors to detach from their OperationContexts and to shed
all storage engine resources before stashing the ClientCursor. This is a
heavier weight operation than a normal save/restoreState which is no longer
allowed to change the OperationContext.
Diffstat (limited to 'src/mongo/db/exec/idhack.cpp')
-rw-r--r-- | src/mongo/db/exec/idhack.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mongo/db/exec/idhack.cpp b/src/mongo/db/exec/idhack.cpp index 2d9a67cfa4f..afc7507a54f 100644 --- a/src/mongo/db/exec/idhack.cpp +++ b/src/mongo/db/exec/idhack.cpp @@ -200,16 +200,26 @@ PlanStage::StageState IDHackStage::advance(WorkingSetID id, } void IDHackStage::doSaveState() { - _txn = NULL; if (_recordCursor) _recordCursor->saveUnpositioned(); } -void IDHackStage::doRestoreState(OperationContext* opCtx) { +void IDHackStage::doRestoreState() { + if (_recordCursor) + _recordCursor->restore(); +} + +void IDHackStage::doDetachFromOperationContext() { + _txn = NULL; + if (_recordCursor) + _recordCursor->detachFromOperationContext(); +} + +void IDHackStage::doReattachToOperationContext(OperationContext* opCtx) { invariant(_txn == NULL); _txn = opCtx; if (_recordCursor) - _recordCursor->restore(opCtx); + _recordCursor->reattachToOperationContext(opCtx); } void IDHackStage::doInvalidate(OperationContext* txn, const RecordId& dl, InvalidationType type) { |