summaryrefslogtreecommitdiff
path: root/src/mongo/db/clientcursor.cpp
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2013-09-23 21:34:11 -0400
committerHari Khalsa <hkhalsa@10gen.com>2013-09-23 21:35:01 -0400
commitabc6784faa11658b485d9b69f483ee0279c0c1f3 (patch)
tree60ad4292d00a0e9c1b924df02c56a00c4669f7d7 /src/mongo/db/clientcursor.cpp
parent44ae87438efc76040d93b039233d7f2ff4f46e3d (diff)
downloadmongo-abc6784faa11658b485d9b69f483ee0279c0c1f3.tar.gz
SERVER-10026 don't kill all runners in ns, don't double-erase WSIDs from sort
Diffstat (limited to 'src/mongo/db/clientcursor.cpp')
-rw-r--r--src/mongo/db/clientcursor.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp
index 22d04a5ebad..c8d1c10d890 100644
--- a/src/mongo/db/clientcursor.cpp
+++ b/src/mongo/db/clientcursor.cpp
@@ -188,16 +188,18 @@ namespace mongo {
if (NULL != cc->_runner.get()) {
verify(NULL == cc->c());
- // If there is a pinValue >= 100, somebody is actively using the CC and we do not
- // delete it. Instead we notify the holder that we killed it. The holder will then
- // delete the CC.
- if (cc->_pinValue >= 100) {
- cc->_runner->kill();
- }
- else {
- // pinvalue is <100, so there is nobody actively holding the CC. We can safely
- // delete it as nobody is holding the CC.
- shouldDelete = true;
+ if (isDB || cc->_runner->ns() == ns) {
+ // If there is a pinValue >= 100, somebody is actively using the CC and we do
+ // not delete it. Instead we notify the holder that we killed it. The holder
+ // will then delete the CC.
+ if (cc->_pinValue >= 100) {
+ cc->_runner->kill();
+ }
+ else {
+ // pinvalue is <100, so there is nobody actively holding the CC. We can
+ // safely delete it as nobody is holding the CC.
+ shouldDelete = true;
+ }
}
}
// Begin cursor-only DEPRECATED