summaryrefslogtreecommitdiff
path: root/src/mongo/db/clientcursor.cpp
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2014-01-13 14:28:54 -0500
committerHari Khalsa <hkhalsa@10gen.com>2014-01-14 10:30:26 -0500
commit12c261b2cb30ed3e50261abad95df249a5503283 (patch)
tree25ad8622f38867b2fc51c074d42f6784a8a69da5 /src/mongo/db/clientcursor.cpp
parent59b0371902b5b278ef1e88a9c15424c6efeea666 (diff)
downloadmongo-12c261b2cb30ed3e50261abad95df249a5503283.tar.gz
SERVER-10026 SERVER-12046 SERVER-12113 runner/stage invalidation can be mutation or deletion
Diffstat (limited to 'src/mongo/db/clientcursor.cpp')
-rw-r--r--src/mongo/db/clientcursor.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp
index c30a73a2ddd..643d1f4aafd 100644
--- a/src/mongo/db/clientcursor.cpp
+++ b/src/mongo/db/clientcursor.cpp
@@ -123,18 +123,6 @@ namespace mongo {
}
}
- // static
- void ClientCursor::assertNoCursors() {
- recursive_scoped_lock lock(ccmutex);
- if (clientCursorsById.size() > 0) {
- log() << "ERROR clientcursors exist but should not at this point" << endl;
- ClientCursor *cc = clientCursorsById.begin()->second;
- log() << "first one: " << cc->_cursorid << ' ' << cc->_ns << endl;
- clientCursorsById.clear();
- verify(false);
- }
- }
-
void ClientCursor::invalidate(const StringData& ns) {
Lock::assertWriteLocked(ns);
@@ -223,19 +211,16 @@ namespace mongo {
}
}
- /* must call this on a delete so we clean up the cursors. */
- void ClientCursor::aboutToDelete(const StringData& ns,
- const NamespaceDetails* nsd,
- const DiskLoc& dl) {
- // Begin cursor-only
+ void ClientCursor::invalidateDocument(const StringData& ns,
+ const NamespaceDetails* nsd,
+ const DiskLoc& dl,
+ InvalidationType type) {
+ // TODO: Do we need this pagefault thing still
NoPageFaultsAllowed npfa;
- // End cursor-only
-
recursive_scoped_lock lock(ccmutex);
Database *db = cc().database();
verify(db);
-
aboutToDeleteForSharding( ns, db, nsd, dl );
// Check our non-cached active runner list.
@@ -244,7 +229,7 @@ namespace mongo {
Runner* runner = *it;
if (0 == ns.compare(runner->ns())) {
- runner->invalidate(dl);
+ runner->invalidate(dl, type);
}
}
@@ -262,7 +247,7 @@ namespace mongo {
// We're only interested in cursors over one db.
if (cc->_db != db) { continue; }
if (NULL == cc->_runner.get()) { continue; }
- cc->_runner->invalidate(dl);
+ cc->_runner->invalidate(dl, type);
}
}
@@ -341,7 +326,7 @@ namespace mongo {
CurOp * c = cc().curop();
while ( c->parent() )
c = c->parent();
- warning() << "ClientCursor::yield can't unlock b/c of recursive lock"
+ warning() << "ClientCursor::staticYield can't unlock b/c of recursive lock"
<< " ns: " << ns
<< " top: " << c->info()
<< endl;