summaryrefslogtreecommitdiff
path: root/db/instance.cpp
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2010-06-06 15:46:55 -0400
committerdwight <dwight@10gen.com>2010-06-06 15:46:55 -0400
commit3f8da3805a1dbff668b1386df8076ec64ef0522d (patch)
tree28558c48f547f2a2bd30b311620e829d18b383a5 /db/instance.cpp
parenta3e03d7fe8900f6ea328b3c878e89bad068bc438 (diff)
downloadmongo-3f8da3805a1dbff668b1386df8076ec64ef0522d.tar.gz
towards QueryOption_Exhaust
Diffstat (limited to 'db/instance.cpp')
-rw-r--r--db/instance.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/db/instance.cpp b/db/instance.cpp
index 9cc9298b84b..126c21efb81 100644
--- a/db/instance.cpp
+++ b/db/instance.cpp
@@ -490,24 +490,28 @@ namespace mongo {
int ntoreturn = d.pullInt();
long long cursorid = d.pullInt64();
- ss << ns << " cid:" << cursorid << " ntoreturn:" << ntoreturn;;
+ ss << ns << " cid:" << cursorid;
+ if( ntoreturn )
+ ss << " ntoreturn:" << ntoreturn;
- int pass = 0;
-
+ int pass = 0;
+ bool exhaust = false;
QueryResult* msgdata;
while( 1 ) {
try {
mongolock lk(false);
Client::Context ctx(ns);
- msgdata = processGetMore(ns, ntoreturn, cursorid, curop, pass );
+ msgdata = processGetMore(ns, ntoreturn, cursorid, curop, pass, exhaust);
}
catch ( GetMoreWaitException& ) {
+ exhaust = false;
massert(13073, "shutting down", !inShutdown() );
pass++;
sleepmillis(2);
continue;
}
catch ( AssertionException& e ) {
+ exhaust = false;
ss << " exception " << e.toString();
msgdata = emptyMoreResult(cursorid);
ok = false;
@@ -521,7 +525,8 @@ namespace mongo {
ss << " nreturned:" << msgdata->nReturned;
dbresponse.response = resp;
dbresponse.responseTo = m.header()->id;
-
+ if( exhaust ) { ss << " exhaust ";
+ dbresponse.exhaust = ns;}
return ok;
}