From 5c9b4a636753e98de0ba7d9d518bfb6516f843d7 Mon Sep 17 00:00:00 2001 From: Jason Rassi Date: Mon, 20 Oct 2014 17:09:18 -0400 Subject: SERVER-15675 Stages should clear their OperationContext in saveState() While state is saved, threads pass in their own OperationContext to invalidate(). When state is restored, the stage will resume with the OperationContext passed in to restoreState(). --- src/mongo/db/exec/text.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mongo/db/exec/text.cpp') diff --git a/src/mongo/db/exec/text.cpp b/src/mongo/db/exec/text.cpp index 60441eb2a81..d06f302e43b 100644 --- a/src/mongo/db/exec/text.cpp +++ b/src/mongo/db/exec/text.cpp @@ -109,6 +109,7 @@ namespace mongo { } void TextStage::saveState() { + _txn = NULL; ++_commonStats.yields; for (size_t i = 0; i < _scanners.size(); ++i) { @@ -117,6 +118,7 @@ namespace mongo { } void TextStage::restoreState(OperationContext* opCtx) { + invariant(_txn == NULL); _txn = opCtx; ++_commonStats.unyields; -- cgit v1.2.1